Merge branch 'develop' into entrepotlibelle

This commit is contained in:
Frédéric FRANCE 2020-05-19 21:13:33 +02:00 committed by GitHub
commit f2ac1992cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
629 changed files with 10371 additions and 6197 deletions

View File

@ -9,8 +9,6 @@ charset = utf-8
end_of_line = lf
insert_final_newline = true
# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/
[*.php]
indent_style = tab
indent_size = 4

View File

@ -194,22 +194,6 @@ tools:
- 'test/*'
- 'htdocs/includes/*'
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
js_hint:

View File

@ -404,6 +404,10 @@ script:
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log
php upgrade2.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-2.log
php step5.php 11.0.0 12.0.0 > $TRAVIS_BUILD_DIR/upgrade11001200-3.log
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?

View File

@ -2,6 +2,83 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 11.0.4 compared to 11.0.3 *****
FIX: #13749
FIX: #7594 Expense report multi pagebreak
FIX: Access to undeclared static property: Contact::$table_element
FIX: actions on supplier proposal not saved (bad trigger name)
FIX: Add function "completeTabsHead" to "addreplace" type hook.
FIX: All forms must use newToken()
FIX: Another "Access to undeclared static property: Contact::$table_element" && "Societe::$table_element"
FIX: author search supplier proposal list
FIX: A variable was erased by a temporary variable
FIX: Avoid infinite loop when a fetch is inside a compute field.
FIX: Backto link
FIX: Bad position of total in column
FIX: bad value in currency into discount created from down payment
FIX: buyprice extrafield langfile and tooltip
FIX: Buyprice was updated only if min price for this qty had same qty
FIX: Can switch from double to price type for extrafields
FIX: Can use decimal value in virtual products
FIX: child categories only with good entity rights
FIX: cloning of emailing when no content selected
FIX: closing tags
FIX: Combo list of available users to filter on the list of leaves.
FIX: Compatibility with multicompany, bad numerotation of task.
FIX: consistency of price w/wo vat wrong when price entered with tax
FIX: default value of selectMasssAction broken
FIX: draftordered replenish virtual stock
FIX: Error update SQL into stock reception
FIX: expensereport status in generated pdf
FIX: extra date field incorrect check
FIX: Extrafields of type price must be '' and not '0' if not defined
FIX: Foreign currency lost when splitting a discount
FIX: get remain to pay with rounding decimals
FIX: gzip and bzip2 must use option -f
FIX: IHM, unexpected quote
FIX: keep viewstatut for doli 3.5
FIX: Link missing into email of some notification
FIX: Look and feel v11
FIX: md stylesheet to be included by external modules like eldy
FIX: missing array option
FIX: missing default accountancy product buy code
FIX: missing fk_bank during export of suppliers invoices
FIX: missing member entity
FIX: missing selectedlines on supplier order but checkbox are displayed
FIX: Missing token and take into account max date when it can.
FIX: model export list must be sorted by label
FIX: multicurrency manage on hidden conf SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL
FIX: Must escape shell
FIX: Must exclude logs and some dirs for compressed backup
FIX: ordered stock already in $stock
FIX: picture migration script from doli 9.0
FIX: print pictures on shipment docs
FIX: product get purchase prices
FIX: product purchase prices
FIX: Protection when database has a corrupted product id
FIX: remove unused var, $usercancreate can be change by Multicompany
FIX: replenish stock to buy
FIX: Sanitizing menu parameter
FIX: Send email from bulk action of list of thirdparties
FIX: setup of suggested payment mode on proposals and orders
FIX: Several pb in export of documents
FIX: Situation invoice take into account the credit notes.
FIX: some others modules (like subtotal) use other product_type than 0 or 1 AND must not be considered in this report
FIX: sort by default role makes no sense
FIX: sort on company on member list
FIX: TakePOS buying price
FIX: text version of html emailing (removed the body style)
FIX: The "test smtp connectivity" failed on page to setup mass emailing
FIX: Error logs an Orderline::delete error, but this is an Orderline::insert error
FIX: Translation of tooltips of extrafields
FIX: Use getNomURL instead of hard coded link. Fix limit.
FIX: Use of image into free text for PDF if DOL_DATA_DIR is outside of
FIX: viewstatut to search status
FIX: we must export company mail address on contact vcard only if contact email address is empty
FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create
FIX: Wrong Sql on getListOfTowns api method
FIX: wrong user right's name to top menu "commercial"
FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security
***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For Users:

View File

@ -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:
- [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
Releases can be downloaded from [official website](https://www.dolibarr.org/).

View File

@ -19,7 +19,7 @@ use Term::ANSIColor;
# Change this to defined target for option 98 and 99
$PROJECT="dolibarr";
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages

View File

@ -6,6 +6,10 @@ This directory contains ruleset files to use to develop Dolibarr EPR & CRM.
To install/upgrade phpcs:
> sudo pear upgrade PHP_CodeSniffer
To run phpcs:
> cd dolibarrgitrepo
> phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
* tab value to 4
* path of code sniffer standard to dev/codesniffer

View File

@ -23,25 +23,21 @@
<!-- Rules from Internal Standard -->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
<rule ref="Internal.NoCodeFound" />
<!-- 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">
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowed"/>
<exclude name="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning"/>
</rule>
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
@ -70,23 +66,12 @@
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
<severity>0</severity>
</rule>
<!--
<!-- Warnings on TODO -->
<!-- Disabled: We want to keep TODO as normal
<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. -->
<rule ref="Generic.Files.ByteOrderMark"/>
@ -106,32 +91,39 @@
</properties>
</rule>
<!-- 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 -->
<rule ref="Generic.Formatting.DisallowMultipleStatements">
<severity>0</severity>
</rule>
<!-- Have 2 chars padding maximum and always show as errors -->
<!--
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties> <property name="maxPadding" value="2"/> <property
name="ignoreMultiLine" value="true"/> </properties> </rule>
-->
<!-- 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">
<properties>
<property name="maxPadding" value="20"/>
<property name="ignoreMultiLine" value="true"/>
</properties>
</rule>
-->
<rule ref="Generic.Formatting.SpaceAfterCast" />
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
<severity>0</severity>
</rule>
<!-- Disallow several spaces after comma -->
<!-- We want to allow this because we want to be able to align params on several similare functions on different lines -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
@ -141,7 +133,7 @@
<!-- Tweaks to metrics -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="120" />
<property name="complexity" value="250" />
<property name="absoluteComplexity" value="300" />
</properties>
</rule>
@ -179,7 +171,6 @@
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
<severity>0</severity>
</rule>
<!-- Disallow usage of tab -->
@ -196,6 +187,13 @@
</properties>
</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" />
@ -205,13 +203,10 @@
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>0</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
<!-- Disabled: We want to have 2 empty line as separator sometimes -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
<severity>0</severity>
</rule>
@ -223,7 +218,6 @@
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
<severity>0</severity>
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
@ -235,23 +229,16 @@
</rule>
<rule ref="Squiz.Scope.MethodScope.Missing" />
<!-- Rules from PEAR Standard -->
<rule ref="PEAR.Classes.ClassDeclaration" />
<!-- Check for duplicate class names -->
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
<rule ref="PEAR.Commenting.ClassComment" />
<!-- TODO Remove this and fix reported errors -->
<rule ref="PEAR.Commenting.ClassComment.Missing">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.Missing" />
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
<severity>0</severity>
@ -260,66 +247,32 @@
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
<severity>0</severity>
</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.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.Empty" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</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">
<severity>0</severity>
</rule>
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle" />
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity>
@ -352,19 +305,21 @@
<!-- Test if () are removed for includes -->
<rule ref="PEAR.Files.IncludingFile" />
<!-- Disable some error messages that we do not want. -->
<!-- We disable this: We must be able to make require inside if -->
<rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<!-- We disable this. We must be allowed to use strict require instead of non strict include anywhere -->
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity>
</rule>
<rule ref="PEAR.Files.IncludingFile.UseRequire">
<severity>0</severity>
<severity>0</severity>
</rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<!-- We disable this: We want to allow include_once -->
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
<severity>0</severity>
</rule>
@ -373,27 +328,25 @@
<rule ref="PEAR.Functions.FunctionCallSignature" />
<!-- TODO Enable this test. -->
<!-- We disable this: It returns a lot of false positive -->
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity>
</rule>
<!-- TODO Enable this test. -->
<!-- We disable this: We want to allow small function on 1 line -->
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine" />
<!-- We disable this: Too many false positive -->
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<severity>0</severity>
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket" />
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket" />
<rule ref="PEAR.Functions.ValidDefaultValue" />
@ -402,26 +355,26 @@
<severity>0</severity>
</rule>
<!-- We disable this: there is a lot of existing method not starting with a capital letter (class modXxxx, ...) -->
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
<severity>0</severity>
<severity>0</severity>
</rule>
<!-- some phpcs have a typo error in rule, so we add it too -->
<!-- some phpcs have a typo error in rule, so we add it this rule too with term "Captial" instead of "Capital" -->
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
<severity>0</severity>
</rule>
<!-- We disable this: there is a lot of existing function not starting with a capital letter (class modXxxx, ...) -->
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital">
<severity>0</severity>
</rule>
<!-- some phpcs have a typo error in rule, so we add it too -->
<!-- some phpcs have a typo error in rule, so we add it this rule too with term "Captial" instead of "Capital" -->
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
<severity>0</severity>
</rule>
@ -432,16 +385,16 @@
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<severity>0</severity>
</rule>-->
<!-- We disable this: We don't want to have private methods prefixed with an underscore -->
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidVariableName" />
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
<!-- This is not in PSR2 -->
<!-- We disable this: We don't want to have private methods prefixed with an underscore -->
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
@ -452,7 +405,6 @@
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
<severity>0</severity>
</rule>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
<severity>0</severity>
</rule>
@ -462,15 +414,17 @@
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
<!-- Rules from Zend Standard-->
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
<rule ref="Zend.Files.ClosingTag"/>
<!-- Rules PSR 2 -->
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
<rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" />
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
<rule ref="PSR2.Files.ClosingTag"/>
</ruleset>

View File

@ -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"> &nbsp; <strong><label for="username">Login</label></strong>fds fs df sdf gdsfgsdf r &nbsp; </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"> &nbsp; <strong><label for="password">Mot de passe</label></strong> &nbsp; </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 -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -161,7 +161,7 @@ if (empty($reshook))
if ($action == 'disable') {
if ($accounting->fetch($id)) {
$mode = GETPOST('mode', 'int');
$result = $accounting->account_desactivate($id, $mode);
$result = $accounting->accountDeactivate($id, $mode);
}
$action = 'update';
@ -488,11 +488,11 @@ if ($resql)
// Action
print '<td class="center">';
if ($user->rights->accounting->chartofaccount) {
print '<a href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print '<a class="editfielda" href="./card.php?action=update&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print img_edit();
print '</a>';
print '&nbsp;';
print '<a href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print '<a class="marginleftonly" href="./card.php?action=delete&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
print img_delete();
print '</a>';
}

View File

@ -696,7 +696,7 @@ if ($id)
print "</td>";
// Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link

View File

@ -408,7 +408,7 @@ llxHeader('', $langs->trans('DictionaryAccountancyCategory'));
$titre = $langs->trans($tablib[$id]);
$linkback = '';
$titlepicto = 'title_setup';
$titlepicto = 'title_accountancy';
print load_fiche_titre($titre, $linkback, $titlepicto);
@ -806,7 +806,7 @@ if ($id)
print "</td>";
// Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link

View File

@ -236,6 +236,7 @@ if (!empty($user->admin))
}
print '</tr>';
/* Set this option as a hidden option but keep it for some needs.
print '<tr>';
print '<td>'.$langs->trans("ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL").'</td>';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) {
@ -248,6 +249,7 @@ if (!empty($user->admin))
print '</a></td>';
}
print '</tr>';
*/
print '<tr>';
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';

View File

@ -657,7 +657,7 @@ if ($id)
print "</td>";
// Modify link
if ($canbemodified) print '<td class="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link

View File

@ -362,7 +362,6 @@ if ($result)
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
print '<br>';
@ -412,7 +411,7 @@ if ($result)
//print '<br><div class="center">'.$buttonsave.'</div>';
$texte = $langs->trans("ListOfProductsServices");
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit);
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
print '<div class="div-table-responsive">';
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';

View File

@ -55,7 +55,7 @@ $pagenext = $page + 1;
//if (! $sortfield) $sortfield="p.date_fin";
//if (! $sortorder) $sortorder="DESC";
$show_subgroup = GETPOST('show_subgroup', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
@ -130,10 +130,11 @@ if (!empty($search_accountancy_code_end)) {
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_accountancy_code_start = '';
$search_accountancy_code_end = '';
$show_subgroup = '';
$search_date_start = '';
$search_date_end = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$filter = array();
}
@ -223,6 +224,12 @@ if ($action != 'export_csv')
$moreforfilter .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0);
$moreforfilter .= $langs->trans('DateEnd').': ';
$moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0);
$moreforfilter .= ' - ';
$moreforfilter .= $langs->trans('ShowSubtotalByGroup').': ';
$moreforfilter .= '<input type="checkbox" name="show_subgroup" value="show_subgroup"'.($show_subgroup == 'show_subgroup' ? ' checked' : '').'>';
$moreforfilter .= '</div>';
if (!empty($moreforfilter)) {
@ -289,26 +296,31 @@ if ($action != 'export_csv')
}
print '<tr class="oddeven">';
// Permet d'afficher le compte comptable
if (empty($displayed_account) || $root_account_description != $displayed_account)
if (!empty($show_subgroup))
{
// Affiche un Sous-Total par compte comptable
if ($displayed_account != "") {
print '<tr class="liste_total"><td class="right" colspan="2">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
print "<td>&nbsp;</td>\n";
// Show accounting account
if (empty($displayed_account) || $root_account_description != $displayed_account) {
// Show subtotal per accounting account
if ($displayed_account != "") {
print '<tr class="liste_total">';
print '<td class="right" colspan="3">'.$langs->trans("SubTotal").':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
print "<td></td>\n";
print '</tr>';
}
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_description;
$sous_total_debit = 0;
$sous_total_credit = 0;
}
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="7" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_description;
$sous_total_debit = 0;
$sous_total_credit = 0;
}
// $object->get_compte_racine($line->numero_compte);
print '<td>'.length_accountg($line->numero_compte).'</td>';
@ -326,12 +338,15 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
if (!empty($show_subgroup))
{
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td><td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
print "<td></td>\n";
print '</tr>';
}
print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("AccountBalance").':</td><td class="nowrap right">'.price($total_debit).'</td><td class="nowrap right">'.price($total_credit).'</td><td class="nowrap right">'.price(price2num($total_debit - $total_credit)).'</td>';
print "<td>&nbsp;</td>\n";
print "<td></td>\n";
print '</tr>';
print "</table>";

View File

@ -438,7 +438,7 @@ if ($action == 'create')
print $langs->trans('Docdate');
print '</td>';
if ($action != 'editdate')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('SetDate'), 1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($action == 'editdate') {
@ -462,7 +462,7 @@ if ($action == 'create')
print $langs->trans('Codejournal');
print '</td>';
if ($action != 'editjournal')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editjournal&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editjournal') {
@ -486,7 +486,7 @@ if ($action == 'create')
print $langs->trans('Piece');
print '</td>';
if ($action != 'editdocref')
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '<td class="right"><a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=editdocref&amp;piece_num='.$object->piece_num.'&amp;mode='.$mode.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editdocref') {
@ -650,8 +650,8 @@ if ($action == 'create')
print '<td class="nowrap right">'.price($line->credit).'</td>';
print '<td class="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
print img_edit();
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.$line->piece_num.'&mode='.$mode.'">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
$actiontodelete = 'delete';

View File

@ -1039,7 +1039,7 @@ while ($i < min($num, $limit))
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@ -57,6 +57,12 @@ $search_direction = GETPOST('search_direction', 'alpha');
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
$search_debit = GETPOST('search_debit', 'alpha');
$search_credit = GETPOST('search_credit', 'alpha');
$search_lettering_code = GETPOST('search_lettering_code', 'alpha');
$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha');
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
$action = 'delbookkeepingyear';
}
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
@ -70,6 +76,13 @@ $pagenext = $page + 1;
if ($sortorder == "") $sortorder = "ASC";
if ($sortfield == "") $sortfield = "t.doc_date,t.rowid";
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new BookKeeping($db);
$hookmanager->initHooks(array('bookkeepingbyaccountlist'));
$formaccounting = new FormAccounting($db);
$form = new Form($db);
if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search_date_startday') && GETPOSTISSET('search_date_startmonth') && GETPOSTISSET('search_date_starthour')) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
@ -96,89 +109,167 @@ if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search
}
}
$object = new BookKeeping($db);
$arrayfields = array(
// 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1),
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1),
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
/*
* Action
*/
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
$parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
$search_doc_date = '';
$search_accountancy_code = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_label_account = '';
$search_doc_ref = '';
$search_label_operation = '';
$search_direction = '';
$search_ledger_code = '';
$search_date_start = '';
$search_date_end = '';
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_debit = '';
$search_credit = '';
include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
{
$search_doc_date = '';
$search_accountancy_code = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$search_label_account = '';
$search_doc_ref = '';
$search_label_operation = '';
$search_direction = '';
$search_ledger_code = '';
$search_date_start = '';
$search_date_end = '';
$search_date_startyear = '';
$search_date_startmonth = '';
$search_date_startday = '';
$search_date_endyear = '';
$search_date_endmonth = '';
$search_date_endday = '';
$search_debit = '';
$search_credit = '';
$search_lettering_code = '';
$search_not_reconciled = '';
}
// Must be after the remove filter action, before the export.
$param = '';
$filter = array();
if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$param .= '&search_date_startmonth=' . GETPOST('search_date_startmonth', 'int') . '&search_date_startday=' . GETPOST('search_date_startday', 'int') . '&search_date_startyear=' . GETPOST('search_date_startyear', 'int');
}
if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$param .= '&search_date_endmonth=' . GETPOST('search_date_endmonth', 'int') . '&search_date_endday=' . GETPOST('search_date_endday', 'int') . '&search_date_endyear=' . GETPOST('search_date_endyear', 'int');
}
if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int');
}
if (!empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (!empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (!empty($search_label_account)) {
$filter['t.label_compte'] = $search_label_account;
$param .= '&search_label_compte=' . urlencode($search_label_account);
}
if (!empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (!empty($search_label_operation)) {
$filter['t.label_operation'] = $search_label_operation;
$param .= '&search_label_operation=' . urlencode($search_label_operation);
}
if (!empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (!empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (!empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if (!empty($search_lettering_code)) {
$filter['t.lettering_code'] = $search_lettering_code;
$param .= '&search_lettering_code='.urlencode($search_lettering_code);
}
if (!empty($search_not_reconciled)) {
$filter['t.reconciled_option'] = $search_not_reconciled;
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
}
}
// Must be after the remove filter action, before the export.
$param = '';
$filter = array();
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
$import_key = GETPOST('importkey', 'alpha');
if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int');
}
if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int');
}
if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
$param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int');
}
if (!empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
}
if (!empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
}
if (!empty($search_label_account)) {
$filter['t.label_compte'] = $search_label_account;
$param .= '&search_label_compte='.urlencode($search_label_account);
}
if (!empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref='.urlencode($search_doc_ref);
}
if (!empty($search_label_operation)) {
$filter['t.label_operation'] = $search_label_operation;
$param .= '&search_label_operation='.urlencode($search_label_operation);
}
if (!empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction='.urlencode($search_direction);
}
if (!empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code='.urlencode($search_ledger_code);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit='.urlencode($search_debit);
}
if (!empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit='.urlencode($search_credit);
}
if (!empty($import_key)) {
$result = $object->deleteByImportkey($import_key);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
// Make a redirect to avoid to launch the delete later after a back button
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
exit;
}
}
if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
$delmonth = GETPOST('delmonth', 'int');
$delyear = GETPOST('delyear', 'int');
if ($delyear == -1) {
$delyear = 0;
}
$deljournal = GETPOST('deljournal', 'alpha');
if ($deljournal == -1) {
$deljournal = 0;
}
if ($action == 'delmouvconfirm') {
if (!empty($delmonth) || !empty($delyear) || !empty($deljournal))
{
$result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
else
{
setEventMessages("RecordDeleted", null, 'mesgs');
}
// Make a redirect to avoid to launch the delete later after a back button
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
exit;
}
else
{
setEventMessages("NoRecordDeleted", null, 'warnings');
}
}
if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
$mvt_num = GETPOST('mvt_num', 'int');
if (!empty($mvt_num)) {
@ -186,8 +277,13 @@ if ($action == 'delmouvconfirm') {
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
Header("Location: listbyaccount.php");
exit();
else
{
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
header("Location: listbyaccount.php?noreset=1".($param ? '&'.$param : ''));
exit;
}
}
@ -229,22 +325,42 @@ if ($action == 'delmouv') {
}
if ($action == 'delbookkeepingyear') {
$form_question = array();
$delyear = GETPOST('delyear');
$delyear = GETPOST('delyear', 'int');
$deljournal = GETPOST('deljournal', 'alpha');
if (empty($delyear)) {
$delyear = dol_print_date(dol_now(), '%Y');
}
$month_array = array();
for ($i = 1; $i <= 12; $i++) {
$month_array[$i] = $langs->trans("Month".sprintf("%02d", $i));
}
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
$journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1);
$form_question['delmonth'] = array(
'name' => 'delmonth',
'type' => 'select',
'label' => $langs->trans('DelMonth'),
'values' => $month_array,
'default' => ''
);
$form_question['delyear'] = array(
'name' => 'delyear',
'type' => 'select',
'label' => $langs->trans('DelYear'),
'values' => $year_array,
'default' => $delyear
'name' => 'delyear',
'type' => 'select',
'label' => $langs->trans('DelYear'),
'values' => $year_array,
'default' => $delyear
);
$form_question['deljournal'] = array(
'name' => 'deljournal',
'type' => 'other', // We don't use select here, the journal_array is already a select html component
'label' => $langs->trans('DelJournal'),
'value' => $journal_array,
'default' => $deljournal
);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1, 250);
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
print $formconfirm;
}
@ -267,53 +383,115 @@ if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($l
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $viewflat.$newcardbutton, '', $limit);
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
// Reverse sort order
if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc";
else $sortorder = "desc";
print '<div class="div-table-responsive">';
print '<table class="noborder centpercent">';
$moreforfilter = '';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<div class="nowrap">';
print $langs->trans('From').' ';
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
// Accountancy account
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('AccountAccounting').': ';
$moreforfilter .= '<div class="nowrap">';
$moreforfilter .= $langs->trans('From').' ';
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
$moreforfilter .= $langs->trans('to').' ';
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
else $moreforfilter = $hookmanager->resPrint;
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print $moreforfilter;
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to').' ';
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
print '</div>';
print '</td>';
print '<td class="liste_titre"></td>';
print '<div class="div-table-responsive">';
print '<table class="tagtable liste centpercent">';
// Filters lines
print '<tr class="liste_titre_filter">';
// Code journal
if (!empty($arrayfields['t.code_journal']['checked'])) {
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . dol_escape_htmltag($search_ledger_code) . '"></td>';
}
// Date document
if (!empty($arrayfields['t.doc_date']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ': ';
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ': ';
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>';
}
// Movement number
if (!empty($arrayfields['t.piece_num']['checked']))
{
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
}
// Ref document
if (!empty($arrayfields['t.doc_ref']['checked'])) {
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
}
// Label operation
if (!empty($arrayfields['t.label_operation']['checked'])) {
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';
}
// Debit
if (!empty($arrayfields['t.debit']['checked'])) {
print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="' . dol_escape_htmltag($search_debit) . '"></td>';
}
// Credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="' . dol_escape_htmltag($search_credit) . '"></td>';
}
// Lettering code
if (!empty($arrayfields['t.lettering_code']['checked']))
{
print '<td class="liste_titre center">';
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
print '</td>';
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="liste_titre center">';
print $langs->trans('From').': ';
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
print '<br>';
print $langs->trans('to').': ';
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
print '</td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"/></td>';
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).'"/></td>';
print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).'"></td>';
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="'.dol_escape_htmltag($search_ledger_code).'"></td>';
print '<td class="liste_titre right" colspan="2">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';
print "</tr>\n";
print '<tr class="liste_titre">';
print_liste_field_titre("AccountAccountingShort", $_SERVER['PHP_SELF']);
print_liste_field_titre("TransactionNumShort", $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Docdate", $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Piece", $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label");
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre("Codejournal", $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60"', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder);
if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
if (!empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
print "</tr>\n";
@ -323,7 +501,10 @@ $sous_total_debit = 0;
$sous_total_credit = 0;
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
// Loop on record
// --------------------------------------------------------------------
$i = 0;
$totalarray = array();
while ($i < min($num, $limit))
{
$line = $object->lines[$i];
@ -336,18 +517,41 @@ while ($i < min($num, $limit))
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
// Affiche un Sous-Total par compte comptable
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 7;
// Show a subtotal by accounting account
if (isset($displayed_account_number)) {
print '<tr class="liste_total"><td class="right" colspan="5">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td>';
print "<td>&nbsp;</td>\n";
print "<td>&nbsp;</td>\n";
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accountg($displayed_account_number).':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td colspan="'.$colspanend.'"></td>';
print '</tr>';
// Show balance of last shown account
$balance = $sous_total_debit - $sous_total_credit;
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
if ($balance > 0 )
{
print '<td class="nowraponall right">';
print price($sous_total_debit - $sous_total_credit);
print '</td>';
print '<td></td>';
}
else
{
print '<td></td>';
print '<td class="nowraponall right">';
print price($sous_total_credit - $sous_total_debit);
print '</td>';
}
print '<td colspan="'.$colspanend.'"></td>';
print '</tr>';
}
// Show the break account
$colspan = 9;
print "<tr>";
print '<td colspan="'.$colspan.'" style="font-weight:bold; border-bottom: 1pt solid black;">';
print '<td colspan="'.$totalarray['nbfield'].'" style="font-weight:bold; border-bottom: 1pt solid black;">';
if ($line->numero_compte != "" && $line->numero_compte != '-1') print length_accountg($line->numero_compte).' : '.$object->get_compte_desc($line->numero_compte);
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
print '</td>';
@ -357,72 +561,212 @@ while ($i < min($num, $limit))
//if (empty($displayed_account_number)) $displayed_account_number='-';
$sous_total_debit = 0;
$sous_total_credit = 0;
$colspan = 0;
}
print '<tr class="oddeven">';
print '<td>&nbsp;</td>';
print '<td class="right"><a href="./card.php?piece_num='.$line->piece_num.'">'.$line->piece_num.'</a></td>';
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
// TODO Add a link according to doc_type and fk_doc
print '<td class="nowrap">';
//if ($line->doc_type == 'supplier_invoice')
//if ($line->doc_type == 'customer_invoice')
print $line->doc_ref;
// Journal code
if (!empty($arrayfields['t.code_journal']['checked']))
{
$accountingjournal = new AccountingJournal($db);
$result = $accountingjournal->fetch('', $line->code_journal);
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
print '<td class="center">'.$journaltoshow.'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Document date
if (!empty($arrayfields['t.doc_date']['checked']))
{
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Piece number
if (!empty($arrayfields['t.piece_num']['checked']))
{
print '<td>';
$object->id = $line->id;
$object->piece_num = $line->piece_num;
print $object->getNomUrl(1, '', 0, '', 1);
print '</td>';
if (!$i) $totalarray['nbfield']++;
}
// Document ref
if (!empty($arrayfields['t.doc_ref']['checked']))
{
if ($line->doc_type == 'customer_invoice')
{
$langs->loadLangs(array('bills'));
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$objectstatic = new Facture($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'facture';
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
elseif ($line->doc_type == 'supplier_invoice')
{
$langs->loadLangs(array('bills'));
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$objectstatic = new FactureFournisseur($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'invoice_supplier';
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
}
elseif ($line->doc_type == 'expense_report')
{
$langs->loadLangs(array('trips'));
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$objectstatic = new ExpenseReport($db);
$objectstatic->fetch($line->fk_doc);
//$modulepart = 'expensereport';
$filename = dol_sanitizeFileName($line->doc_ref);
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
}
else
{
// Other type
}
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
{
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
print $documentlink;
} else {
print $line->doc_ref;
}
print '</td></tr></table>';
print "</td>\n";
if (!$i) $totalarray['nbfield']++;
}
// Label operation
if (!empty($arrayfields['t.label_operation']['checked'])) {
// Affiche un lien vers la facture client/fournisseur
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>' . $line->label_operation . '</td>' : '<td>' . $line->label_operation . '<br><span style="font-size:0.8em">(' . length_accounta($line->subledger_account) . ')</span></td>';
if (!$i) $totalarray['nbfield']++;
}
// Amount debit
if (!empty($arrayfields['t.debit']['checked']))
{
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
$totalarray['val']['totaldebit'] += $line->debit;
}
// Amount credit
if (!empty($arrayfields['t.credit']['checked'])) {
print '<td class="nowrap right">' . ($line->credit ? price($line->credit) : '') . '</td>';
if (!$i) $totalarray['nbfield']++;
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
$totalarray['val']['totalcredit'] += $line->credit;
}
// Lettering code
if (!empty($arrayfields['t.lettering_code']['checked']))
{
print '<td class="center">'.$line->lettering_code.'</td>';
if (!$i) $totalarray['nbfield']++;
}
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
}
if ($user->rights->accounting->mouvements->supprimer) {
print '&nbsp;<a href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}
}
print '</td>';
// Affiche un lien vers la facture client/fournisseur
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
$accountingjournal = new AccountingJournal($db);
$result = $accountingjournal->fetch('', $line->code_journal);
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
print '<td class="center">'.$journaltoshow.'</td>';
print '<td class="center">';
print '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.'">'.img_edit().'</a>&nbsp;';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.'">'.img_delete().'</a>';
print '</td>';
print "</tr>\n";
if (!$i) $totalarray['nbfield']++;
// Comptabilise le sous-total
$sous_total_debit += $line->debit;
$sous_total_credit += $line->credit;
print "</tr>\n";
$i++;
}
// Show sub-total of last shown account
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 8;
print '<tr class="liste_total">';
print '<td class="right" colspan="5">'.$langs->trans("SubTotal").':</td><td class="nowrap right">'.price($sous_total_debit).'</td><td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td class="nowraponall center">';
print price($sous_total_debit - $sous_total_credit);
print '</td>';
print '<td></td>';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
print '<td colspan="'.$colspanend.'"></td>';
print '</tr>';
// Show balance of last shown account
$balance = $sous_total_debit - $sous_total_credit;
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
if ($balance > 0 )
{
print '<td class="nowraponall right">';
print price($sous_total_debit - $sous_total_credit);
print '</td>';
print '<td></td>';
}
else
{
print '<td></td>';
print '<td class="nowraponall right">';
print price($sous_total_credit - $sous_total_debit);
print '</td>';
}
print '<td colspan="'.$colspanend.'"></td>';
print '</tr>';
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
// Show total
print '<tr class="liste_total">';
print '<td class="right" colspan="5">'.$langs->trans("Total").':</td>';
print '<td class="nowraponall right">';
print price($total_debit);
print '</td>';
print '<td class="nowraponall right">';
print price($total_credit);
print '</td>';
print '<td></td>';
print '<td></td>';
print '</tr>';
print "</table>";
print '</div>';
// TODO Replace this with mass delete action
if ($user->rights->accounting->mouvements->supprimer_tous) {
print '<div class="tabsAction tabsActionNoBottom">'."\n";
print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear'.($param ? '&'.$param : '').'">'.$langs->trans("DeleteMvt").'</a>';
print '</div>';
}
print '</form>';
// End of page

View File

@ -5,11 +5,12 @@
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2017 André Schild <a.schild@aarboard.ch>
* Copyright (C) 2020 Guillaume Alexandre <guillaume@tag-info.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -52,6 +53,7 @@ class AccountancyExport
public static $EXPORT_TYPE_SAGE50_SWISS = 45;
public static $EXPORT_TYPE_CHARLEMAGNE = 50;
public static $EXPORT_TYPE_QUADRATUS = 60;
public static $EXPORT_TYPE_WINFIC = 70;
public static $EXPORT_TYPE_OPENCONCERTO = 100;
public static $EXPORT_TYPE_LDCOMPTA = 110;
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
@ -105,6 +107,7 @@ class AccountancyExport
self::$EXPORT_TYPE_BOB50 => $langs->trans('Modelcsv_bob50'),
self::$EXPORT_TYPE_CIEL => $langs->trans('Modelcsv_ciel'),
self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'),
self::$EXPORT_TYPE_WINFIC => $langs->trans('Modelcsv_winfic'),
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
@ -136,6 +139,7 @@ class AccountancyExport
self::$EXPORT_TYPE_BOB50 => 'bob50',
self::$EXPORT_TYPE_CIEL => 'ciel',
self::$EXPORT_TYPE_QUADRATUS => 'quadratus',
self::$EXPORT_TYPE_WINFIC => 'winfic',
self::$EXPORT_TYPE_EBP => 'ebp',
self::$EXPORT_TYPE_COGILOG => 'cogilog',
self::$EXPORT_TYPE_AGIRIS => 'agiris',
@ -184,6 +188,10 @@ class AccountancyExport
'label' => $langs->trans('Modelcsv_quadratus'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_WINFIC => array(
'label' => $langs->trans('Modelcsv_winfic'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_EBP => array(
'label' => $langs->trans('Modelcsv_ebp'),
),
@ -246,7 +254,7 @@ class AccountancyExport
$filename = 'general_ledger-'.$this->getFormatCode($formatexportset);
$type_export = 'general_ledger';
global $db; // The tpl file use $db
global $db; // The tpl file use $db
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
@ -269,6 +277,9 @@ class AccountancyExport
case self::$EXPORT_TYPE_QUADRATUS :
$this->exportQuadratus($TData);
break;
case self::$EXPORT_TYPE_WINFIC :
$this->exportWinfic($TData);
break;
case self::$EXPORT_TYPE_EBP :
$this->exportEbp($TData);
break;
@ -548,6 +559,85 @@ class AccountancyExport
}
}
/**
* Export format : WinFic - eWinfic - WinSis Compta
*
*
* @param array $TData data
* @return void
*/
public function exportWinfic(&$TData)
{
global $conf;
$end_line = "\r\n";
//We should use dol_now function not time however this is wrong date to transfert in accounting
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
foreach ($TData as $data) {
$code_compta = $data->numero_compte;
if (!empty($data->subledger_account))
$code_compta = $data->subledger_account;
$Tab = array();
//$Tab['type_ligne'] = 'M';
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
//$Tab['date_ecriture'] = $date_ecriture;
$Tab['date_operation'] = dol_print_date($data->doc_date, '%d%m%Y');
$Tab['folio'] = ' 1';
$Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
if($data->sens == 'D'){
$Tab['montant_debit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
else{
$Tab['montant_debit'] = str_pad(number_format(0, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
$Tab['montant_crebit'] = str_pad(number_format(abs($data->montant), 2, ',', ''), 13, ' ', STR_PAD_LEFT);
}
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
$Tab['lettrage'] = str_repeat(' ', 2);
$Tab['code_piece'] = str_repeat(' ', 5);
$Tab['code_stat'] = str_repeat(' ', 4);
if (!empty($data->date_echeance))
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
else
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
$Tab['monnaie'] = '1';
$Tab['filler'] = ' ';
$Tab['ind_compteur'] = ' ';
$Tab['quantite'] = '0,000000000';
$Tab['code_pointage'] = str_repeat(' ', 2);
$Tab['end_line'] = $end_line;
print implode('|', $Tab);
}
}
/**
* Export format : EBP
@ -930,7 +1020,7 @@ class AccountancyExport
}
/**
* Export format : LD Compta version 9 & higher
* Export format : LD Compta version 9
* http://www.ldsysteme.fr/fileadmin/telechargement/np/ldcompta/Documentation/IntCptW9.pdf
*
* @param array $objectLines data

View File

@ -553,24 +553,19 @@ class AccountingAccount extends CommonObject
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Account deactivated
* Deactivate an account (for status active or status reconcilable)
*
* @param int $id Id
* @param int $mode 0=field active, 1=field active_customer_list, 2=field_active_supplier_list
* @param int $mode 0=field active, 1=field reconcilable
* @return int <0 if KO, >0 if OK
*/
public function account_desactivate($id, $mode = 0)
public function accountDeactivate($id, $mode = 0)
{
// phpcs:enable
$result = $this->checkUsage();
if ($mode == 0)
{
$fieldtouse = 'active';
}
elseif ($mode == 1)
$fieldtouse = 'active';
if ($mode == 1)
{
$fieldtouse = 'reconcilable';
}
@ -582,7 +577,7 @@ class AccountingAccount extends CommonObject
$sql .= "SET ".$fieldtouse." = '0'";
$sql .= " WHERE rowid = ".$this->db->escape($id);
dol_syslog(get_class($this)."::account_desactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {

View File

@ -704,7 +704,7 @@ class BookKeeping extends CommonObject
$sql .= ' WHERE 1 = 1';
$sql .= " AND entity IN (".getEntity('accountancy').")";
if (null !== $ref) {
$sql .= ' AND t.ref = '.'\''.$ref.'\'';
$sql .= " AND t.ref = '".$this->db->escape($ref)."'";
} else {
$sql .= ' AND t.rowid = '.$id;
}

View File

@ -1,6 +1,6 @@
<?php
/* 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-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -27,10 +27,11 @@
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.'/product/class/product.class.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/company.lib.php';
@ -42,6 +43,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
$search_lineid = GETPOST('search_lineid', 'int');
$search_ref = GETPOST('search_ref', 'alpha');
$search_invoice = GETPOST('search_invoice', 'alpha');
@ -89,6 +91,7 @@ $formaccounting = new FormAccounting($db);
// 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
{
$search_societe='';
$search_lineid = '';
$search_ref = '';
$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 .= " fd.situation_percent,";
$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();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
@ -193,6 +196,10 @@ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
} else {
$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) {
$sql .= natural_search("fd.rowid", $search_lineid, 1);
}
@ -262,6 +269,7 @@ if ($result) {
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
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_ref) $param .= "&search_ref=".urlencode($search_ref);
if ($search_label) $param .= "&search_label=".urlencode($search_label);
@ -296,7 +304,7 @@ if ($result) {
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
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 center nowraponall">';
if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) {
@ -310,8 +318,9 @@ 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 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"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
print '<td class="liste_titre">';
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', '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 '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
@ -330,6 +339,7 @@ if ($result) {
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("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("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $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 "</tr>\n";
$thirdpartystatic=new Societe($db);
$facture_static = new Facture($db);
$product_static = new Product($db);
@ -347,6 +358,17 @@ if ($result) {
$facture_static->id = $objp->facid;
$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->id = $objp->product_id;
$product_static->label = $objp->product_label;
@ -367,7 +389,7 @@ if ($result) {
print '<td>';
if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print $objp->product_label;
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
print '</td>';
print '<td class="tdoverflowonsmartphone">';
@ -380,6 +402,9 @@ if ($result) {
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
print '<td>';
if ($objp->country_code)

View File

@ -1,6 +1,6 @@
<?php
/* 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) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -27,12 +27,13 @@
*/
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.'/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.'/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/company.lib.php';
@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array');
$mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
$search_lineid = GETPOST('search_lineid', 'int');
$search_ref = GETPOST('search_ref', 'alpha');
$search_invoice = GETPOST('search_invoice', 'alpha');
@ -112,6 +114,7 @@ if (empty($reshook))
// 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
{
$search_societe='';
$search_lineid = '';
$search_ref = '';
$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 .= " 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 .= " 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();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$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 .= " AND l.product_type <= 2";
// Add search filter like
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@ -314,6 +320,7 @@ if ($result) {
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
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_day) $param .= '&search_day='.urlencode($search_day);
if ($search_month) $param .= '&search_month='.urlencode($search_month);
@ -363,7 +370,7 @@ if ($result) {
// We add search 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 center nowraponall minwidth100imp">';
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 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"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
print '<td class="liste_titre">';
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) . '">';
@ -399,6 +407,7 @@ if ($result) {
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("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("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
@ -408,6 +417,7 @@ if ($result) {
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
print "</tr>\n";
$thirdpartystatic = new Societe($db);
$facture_static = new Facture($db);
$product_static = new Product($db);
@ -421,6 +431,17 @@ if ($result) {
$objp->code_sell_l = '';
$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->id = $objp->product_id;
$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 '</td>';
// Thirdparty
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'customer') . '</td>';
// Country
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;
@ -567,12 +591,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>';
// Found accounts
print '<td style="'.$code_sell_p_notset.'">';
print '<td>';
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("NotDefined"));
$s .= ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0)
{
@ -583,7 +607,7 @@ if ($result) {
elseif ($suggestedaccountingaccountfor == 'eecwithvat') $shelp = $langs->trans("SaleEECWithVAT");
elseif ($suggestedaccountingaccountfor == 'eecwithoutvatnumber') $shelp = $langs->trans("SaleEECWithoutVATNumber");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s .= (empty($objp->code_sell_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_sell_p));
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';

View File

@ -252,6 +252,9 @@ if ($result) {
print '<tr class="liste_titre_filter">';
print '<td class="liste_titre"></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">';
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.'">';
@ -272,7 +275,10 @@ if ($result) {
print '<tr class="liste_titre">';
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("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("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
@ -299,6 +305,11 @@ if ($result) {
// Ref Invoice
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="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';

View File

@ -42,6 +42,9 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$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
$mesCasesCochees = GETPOST('toselect', 'array');
@ -183,7 +186,7 @@ if (empty($chartaccountcode))
}
// 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 .= " 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";
@ -240,8 +243,8 @@ if ($result) {
$arrayofselected = is_array($toselect) ? $toselect : array();
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
if ($search_lineid) $param .= '&search_lineid='.urlencode($search_lineid);
if ($search_day) $param .= '&search_day='.urlencode($search_day);
if ($search_month) $param .= '&search_month='.urlencode($search_month);
@ -288,6 +291,9 @@ if ($result) {
print '<tr class="liste_titre_filter">';
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>';
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print '<td class="liste_titre"></td>';
}
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.'">';
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_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("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("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 ');
@ -341,6 +350,11 @@ if ($result) {
// Ref Expense report
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
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';

View File

@ -88,7 +88,7 @@ if ($conf->accounting->enabled)
}
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial);
print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'title_accountancy', 0, '', '', $showtutorial);
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
print "<br>\n";
@ -101,13 +101,13 @@ if ($conf->accounting->enabled)
// STEPS
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
print "<br>\n";
print "<br>\n";
@ -116,20 +116,20 @@ if ($conf->accounting->enabled)
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong>'.'</a>')."\n";
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
print "<br>\n";
$step++;
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>'.'</a>';
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
print "<br>\n";
if (!empty($conf->tax->enabled))
{
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>'.'</a>';
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
print "<br>\n";
@ -145,7 +145,7 @@ if ($conf->accounting->enabled)
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
print "<br>\n";
}
/*
@ -169,7 +169,7 @@ if ($conf->accounting->enabled)
}*/
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php">'.'<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong>'.'</a>');
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
print "<br>\n";
@ -186,17 +186,17 @@ if ($conf->accounting->enabled)
$langs->loadLangs(array('bills', 'trips'));
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>'.'</a>')."\n";
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>')."\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>'.'</a>')."\n";
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>')."\n";
print "<br>\n";
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php">'.'<strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>'.'</a>')."\n";
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>')."\n";
print "<br>\n";
}

View File

@ -994,7 +994,7 @@ if (empty($action) || $action == 'view') {
print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {

View File

@ -508,7 +508,7 @@ if (empty($action) || $action == 'view') {
}
print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
}

View File

@ -740,7 +740,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
}
@ -936,7 +936,7 @@ if (empty($action) || $action == 'view') {
$accountoshow = length_accountg($k);
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')'.'</span>';
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Purchase").')</span>';
}
else print $accountoshow;
print "</td>";
@ -959,15 +959,15 @@ if (empty($action) || $action == 'view') {
foreach ($tabother[$key] as $k => $mt) {
if ($mt) {
print '<tr class="oddeven">';
print "<!-- VAT counterpart NPR -->";
print '<!-- VAT counterpart NPR -->';
print "<td>".$date."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
print '<td>';
$accountoshow = length_accountg($k);
if (($accountoshow == "") || $accountoshow == 'NotDefined')
if ($accountoshow == '' || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account'.'</span>';
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("NPR counterpart").'). Set ACCOUNTING_COUNTERPART_VAT_NPR to the subvention account</span>';
}
else print $accountoshow;
print '</td>';

View File

@ -677,7 +677,7 @@ if (empty($action) || $action == 'view') {
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
}
print '<div class="tabsAction tabsActionNoBottom">';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL)) print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
}
@ -874,7 +874,7 @@ if (empty($action) || $action == 'view') {
$accountoshow = length_accountg($k);
if (($accountoshow == "") || $accountoshow == 'NotDefined')
{
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')'.'</span>';
print '<span class="error">'.$langs->trans("VATAccountNotDefined").' ('.$langs->trans("Sale").')</span>';
}
else print $accountoshow;
print "</td>";

View File

@ -1,6 +1,6 @@
<?php
/* 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) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@ -27,12 +27,13 @@
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.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/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/company.lib.php';
@ -44,6 +45,7 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
$account_parent = GETPOST('account_parent');
$changeaccount = GETPOST('changeaccount');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
$search_lineid = GETPOST('search_lineid', 'int');
$search_ref = GETPOST('search_ref', 'alpha');
$search_invoice = GETPOST('search_invoice', 'alpha');
@ -91,6 +93,7 @@ $formaccounting = new FormAccounting($db);
// 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
{
$search_societe = '';
$search_lineid = '';
$search_ref = '';
$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 .= " 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 .= " 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();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$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 .= " 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 ";
// Add search filter like
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@ -264,6 +271,7 @@ if ($result) {
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
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_ref) $param .= "&search_ref=".urlencode($search_ref);
if ($search_label) $param .= "&search_label=".urlencode($search_label);
@ -300,7 +308,7 @@ if ($result) {
// We add search 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_label" value="'.dol_escape_htmltag($search_label).'"></td>';
print '<td class="liste_titre center nowraponall">';
@ -312,8 +320,9 @@ 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 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"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
print '<td class="liste_titre">';
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth200', '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 '</td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
@ -334,6 +343,7 @@ if ($result) {
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("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("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $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 "</tr>\n";
$thirdpartystatic = new Societe($db);
$facturefournisseur_static = new FactureFournisseur($db);
$product_static = new ProductFournisseur($db);
@ -352,6 +363,17 @@ if ($result) {
$facturefournisseur_static->ref = $objp->ref;
$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->id = $objp->product_id;
$product_static->label = $objp->product_label;
@ -376,7 +398,7 @@ if ($result) {
print '<td class="tdoverflowmax100">';
if ($product_static->id > 0) print $product_static->getNomUrl(1);
if ($product_static->id > 0 && $objp->product_label) print '<br>';
if ($objp->product_label) print $objp->product_label;
if ($objp->product_label) print '<span class="opacitymedium">'.$objp->product_label.'</span>';
print '</td>';
// Description
@ -390,6 +412,10 @@ if ($result) {
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>';
if ($objp->country_code)
{
@ -400,7 +426,7 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>';
print '<td>';
print $codecompta.' <a href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print $codecompta.' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
print img_edit();
print '</a></td>';
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';

View File

@ -27,12 +27,13 @@
*/
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.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.'/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/company.lib.php';
@ -49,6 +50,7 @@ $toselect = GETPOST('toselect', 'array');
$mesCasesCochees = GETPOST('toselect', 'array');
// Search Getpost
$search_societe = GETPOST('search_societe', 'alpha');
$search_lineid = GETPOST('search_lineid', 'int');
$search_invoice = GETPOST('search_invoice', 'alpha');
$search_ref = GETPOST('search_ref', 'alpha');
@ -116,6 +118,7 @@ if (empty($reshook))
// 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
{
$search_societe='';
$search_lineid = '';
$search_ref = '';
$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 .= " 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 .= " 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();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$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 .= " AND l.product_type <= 2";
// Add search filter like
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
}
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@ -314,6 +320,7 @@ if ($result) {
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
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_day) $param .= '&search_day='.urlencode($search_day);
if ($search_month) $param .= '&search_month='.urlencode($search_month);
@ -364,7 +371,7 @@ if ($result) {
// We add search 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_label" value="'.dol_escape_htmltag($search_label).'"></td>';
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 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"><input type="text" class="flat maxwidth75imp" name="search_societe" value="' . dol_escape_htmltag($search_societe) . '"></td>';
print '<td class="liste_titre">';
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) . '">';
@ -399,6 +407,7 @@ if ($result) {
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("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("VATIntra", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("AccountAccountingSuggest", '', '', '', '', '', '', '', 'nowraponall ');
@ -408,6 +417,7 @@ if ($result) {
print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
print "</tr>\n";
$thirdpartystatic=new Societe($db);
$facturefourn_static = new FactureFournisseur($db);
$product_static = new Product($db);
@ -424,6 +434,17 @@ if ($result) {
$objp->code_buy_l = '';
$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->id = $objp->product_id;
$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 '</td>';
// Thirdparty
print '<td class="tdoverflowmax100">' . $thirdpartystatic->getNomUrl(1, 'supplier') . '</td>';
// Country
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;
@ -553,12 +577,12 @@ if ($result) {
print '<td>'.$objp->tva_intra.'</td>';
// Found accounts
print '<td style="'.$code_buy_p_notset.'">';
print '<td>';
$s = '<span class="small">'.(($objp->type_l == 1) ? $langs->trans("DefaultForService") : $langs->trans("DefaultForProduct")).': </span>';
$shelp = '';
if ($suggestedaccountingaccountbydefaultfor == 'eec') $shelp .= $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountbydefaultfor == 'export') $shelp .= $langs->trans("SaleExport");
$s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : $langs->trans("NotDefined"));
$s .= ($objp->code_buy_l > 0 ? length_accountg($objp->code_buy_l) : '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if ($objp->product_id > 0)
{
@ -567,7 +591,7 @@ if ($result) {
$shelp = '';
if ($suggestedaccountingaccountfor == 'eec') $shelp = $langs->trans("SaleEEC");
elseif ($suggestedaccountingaccountfor == 'export') $shelp = $langs->trans("SaleExport");
$s .= (empty($objp->code_buy_p) ? $langs->trans("NotDefined") : length_accountg($objp->code_buy_p));
$s .= (empty($objp->code_buy_p) ? '<span style="'.$code_buy_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_buy_p));
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';

View File

@ -60,6 +60,9 @@ class Adherent extends CommonObject
*/
public $ismultientitymanaged = 1;
public $picto = 'member';
public $mesgs;
/**

View File

@ -183,20 +183,14 @@ class AdherentType extends CommonObject
$sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email='".$this->db->escape($this->other)."'";
}
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
}
else
{
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email";
}
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label)."',";
$sql2 .= " '".$this->db->escape($this->description)."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->other)."'";
}
$sql2 .= ")";
}
dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key);
@ -219,20 +213,14 @@ class AdherentType extends CommonObject
$sql2 .= " SET ";
$sql2 .= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email='".$this->db->escape($this->multilangs["$key"]["other"])."'";
}
$sql2 .= " WHERE fk_type=".$this->id." AND lang='".$this->db->escape($key)."'";
}
else
{
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type_lang (fk_type, lang, label, description";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", email";
}
$sql2 .= ")";
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " '".$this->db->escape($this->multilangs["$key"]["description"])."'";
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) { $sql2 .= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'";
}
$sql2 .= ")";
}

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2017 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) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -22,7 +22,7 @@
/**
* \file htdocs/adherents/index.php
* \ingroup member
* \brief Page accueil module adherents
* \brief Home page of membership module
*/
require '../main.inc.php';
@ -339,7 +339,7 @@ if ($resql)
$staticmember->ref = $staticmember->getFullName($langs);
$statictype->id = $obj->typeid;
$statictype->label = $obj->label;
print '<td>'.$staticmember->getNomUrl(1, 32).'</td>';
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32).'</td>';
print '<td>'.$statictype->getNomUrl(1, 32).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
print '<td class="right">'.$staticmember->LibStatut($obj->statut, ($obj->subscription == 'yes' ? 1 : 0), $db->jdate($obj->date_end_subscription), 3).'</td>';
@ -399,12 +399,12 @@ if ($resql)
$staticmember->name = $obj->company;
}
$staticmember->ref = $staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td>'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>';
print '<td>'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
print '<td class="nowraponall">'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td class="nowraponall">'.$staticmember->getNomUrl(1, 32, 'subscription').'</td>';
print '<td class="nowraponall">'.get_date_range($db->jdate($obj->date_start), $db->jdate($obj->date_end)).'</td>';
print '<td class="right">'.price($obj->subscription).'</td>';
//print '<td class="right">'.$staticmember->LibStatut($obj->statut,($obj->subscription=='yes'?1:0),$db->jdate($obj->date_end_subscription),5).'</td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').'</td>';
print '<td class="right nowraponall">'.dol_print_date($db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour').'</td>';
print '</tr>';
$i++;
}

View File

@ -877,7 +877,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation

View File

@ -521,7 +521,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation

View File

@ -81,8 +81,10 @@ if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
}
if ($action == 'set')
{
$getDefaultFilter = GETPOST('AGENDA_DEFAULT_FILTER_TYPE');
$defaultfilter = (is_array($getDefaultFilter)) ? implode(',', $getDefaultFilter) : $getDefaultFilter;
dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
}
@ -377,7 +379,12 @@ print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right nowrap">'."\n";
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1);
$multiselect = 0;
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) {
// We use an option here because it adds bugs when used on agenda page "peruser" and "list"
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect);
print '</td></tr>'."\n";
// AGENDA_DEFAULT_FILTER_STATUS

View File

@ -693,7 +693,7 @@ print '<br>';
// 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 '<tr class="liste_titre">';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013-2017 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -83,6 +84,20 @@ if ($action == 'update')
}
}
$report_include_varpay = GETPOST('ACCOUNTING_REPORTS_INCLUDE_VARPAY', 'alpha');
if (!empty($report_include_varpay))
if ($report_include_varpay == 'yes')
if (!dolibarr_set_const($db, 'ACCOUNTING_REPORTS_INCLUDE_VARPAY', 1, 'chaine', 0, '', $conf->entity)) $error++;
if ($report_include_varpay == 'no')
if (!dolibarr_del_const($db, 'ACCOUNTING_REPORTS_INCLUDE_VARPAY', $conf->entity)) $error++;
$report_include_loan = GETPOST('ACCOUNTING_REPORTS_INCLUDE_LOAN', 'alpha');
if (!empty($report_include_loan))
if ($report_include_loan == 'yes')
if (!dolibarr_set_const($db, 'ACCOUNTING_REPORTS_INCLUDE_LOAN', 1, 'chaine', 0, '', $conf->entity)) $error++;
if ($report_include_loan == 'no')
if (!dolibarr_del_const($db, 'ACCOUNTING_REPORTS_INCLUDE_LOAN', $conf->entity)) $error++;
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@ -158,6 +173,20 @@ foreach ($list as $key)
print '</td></tr>';
}
// Option to include various payment in results
print '<tr class="oddeven value">'."\n";
print '<td><label for="ACCOUNTING_REPORTS_INCLUDE_VARPAY">'.$langs->trans('IncludeVarpaysInResults').'</label></td>'."\n";
print '<td class="center">'."\n";
print $form->selectyesno('ACCOUNTING_REPORTS_INCLUDE_VARPAY', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY)));
print '</td></tr>';
// Option to include loan in results
print '<tr class="oddeven value">'."\n";
print '<td><label for="ACCOUNTING_REPORTS_INCLUDE_LOAN">'.$langs->trans('IncludeLoansInResults').'</label></td>'."\n";
print '<td class="center">'."\n";
print $form->selectyesno('ACCOUNTING_REPORTS_INCLUDE_LOAN', (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN)));
print '</td></tr>';
print "</table>\n";
print '<br><br><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';

View File

@ -328,10 +328,10 @@ if ($conf->use_javascript_ajax)
{
print '<br>';
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 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>';
}

View File

@ -503,7 +503,7 @@ $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[35] = array();
$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'));
// List of check for fields (NOT USED YET)
@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((!isset($_POST[$value]) || $_POST[$value] == '')
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory
@ -1718,7 +1719,7 @@ if ($id)
print "</td>";
// Modify link
if ($canbemodified) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
if ($canbemodified) print '<td align="center"><a class="reposition editfielda" href="'.$url.'action=edit">'.img_edit().'</a></td>';
else print '<td>&nbsp;</td>';
// Delete link

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>.
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modifyion 2.0 (the "License");
* it under the terms of the GNU General Public License as published bypliance with the License.
@ -17,6 +18,9 @@
*/
if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1);
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
/**

View File

@ -213,19 +213,17 @@ class Dolistore
{
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" '
.'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'"'
.'>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"'
.' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" '
.'>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} else {
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
}
}
@ -250,11 +248,8 @@ class Dolistore
// phpcs:enable
global $langs, $conf;
$html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ?
$newapp = '';
if ($last_month < strtotime($product->date_add)) {
@ -269,8 +264,8 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="fancybox" rel="gallery'.$product->id.'" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">'.
'<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
}
@ -308,16 +303,16 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app '.$parity.' '.$compatible.'">
$html .= '<tr class="app oddeven '.$compatible.'">
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
.'<br/><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>
<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>
<td class="margeCote center">'.$price.'
</td>
<td class="margeCote">'.$download_link.'</td>
</tr>';
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
// do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.$price.'</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>';
}
return $html;
}

View File

@ -592,7 +592,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<input type="text" name="operationparam">';
$htmltext = $langs->transnoentitiesnoconv("OperationParamDesc");
//var_dump($htmltext);
print $form->textwithpicto('', $htmltext);
print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt');
print '</td>';
print '<td></td>';
print '<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button" value="'.$langs->trans("Add").'"></td>';
@ -643,7 +643,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</td>';
// Delete
print '<td class="right nowraponall">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
print '<a class="editfielda marginrightonly" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().'</a>';
print ' <a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=deleteoperation&operationid='.$ruleaction['id'].'">'.img_delete().'</a>';
print '</td>';
print '</tr>';

View File

@ -476,7 +476,7 @@ while ($i < min($num, $limit))
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column

View File

@ -368,20 +368,20 @@ foreach ($dirmodels as $reldir)
{
if (file_exists($dir.'/'.$file))
{
$name = substr($file, 4, dol_strlen($file) -16);
$classname = substr($file, 0, dol_strlen($file) -12);
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified=1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
if ($modulequalified)
{
print '<tr class="oddeven"><td width="100">';
print (empty($module->name)?$name:$module->name);
print (empty($module->name) ? $name : $module->name);
print "</td><td>\n";
if (method_exists($module, 'info')) print $module->info($langs);
else print $module->description;

View File

@ -240,9 +240,9 @@ dol_syslog("select rss boxes", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
$num = $db->num_rows($resql);
$i = 0;
$boxlist = InfoBox::listBoxes($db, 'activated', -1, null);
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
@ -271,19 +271,19 @@ if ($resql)
print '<input type="submit" class="button buttongen" name="delete" value="'.$langs->trans("Delete").'">';
print '<input type="hidden" name="norss" value="'.$idrss.'">';
print '</td>';
print "</tr>"."\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
print "<td width=\"100px\">".$langs->trans("Title")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrsstitle)."\"></td>";
print "</tr>"."\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
print "<td>".$langs->trans("URL")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_".$idrss."\" value=\"".dol_escape_htmltag($conf->global->$keyrssurl)."\"></td>";
print "</tr>"."\n";
print '</tr>'."\n";
print '<tr class="oddeven">';
@ -301,7 +301,7 @@ if ($resql)
print '</div>';
}
print "</td>";
print "</tr>"."\n";
print '</tr>'."\n";
// Logo
if ($result > 0 && empty($rss->error))
@ -315,7 +315,7 @@ if ($resql)
if ($imageurl) print '<img height="32" src="'.$imageurl.'">';
else print $langs->trans("None");
print '</td>';
print "</tr>"."\n";
print '</tr>'."\n";
}
// Active
@ -323,11 +323,11 @@ if ($resql)
print '<tr class="oddeven">';
print '<td>'.$langs->trans('WidgetEnabled').'</td>';
print '<td>'.yn($active).'</td>';
print "</tr>"."\n";
print '</tr>'."\n";
print '</table>'."\n";
print "</form>"."\n";
print "</form>\n";
$i++;
}
@ -350,9 +350,9 @@ $db->close();
*/
function _isInBoxList($idrss, array $boxlist)
{
foreach($boxlist as $box)
foreach ($boxlist as $box)
{
if($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
if ($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false)
{
return true;
}

View File

@ -36,13 +36,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'errors', 'other', 'bills'));
if (! $user->admin) accessforbidden();
if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'alpha');
$value = GETPOST('value', 'alpha');
$label = GETPOST('label', 'alpha');
$scandir = GETPOST('scan_dir', 'alpha');
$type='invoice';
$type = 'invoice';
/*
@ -57,17 +57,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
* View
*/
$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']);
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
llxHeader(
"", $langs->trans("BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'
);
$form=new Form($db);
$form = new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup');
$head = invoice_admin_prepare_head();
@ -106,12 +106,12 @@ $arrayAvailableType = array(
);
$selected = array();
$implodeglue = '+';
if(!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})){
if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) {
$selected = explode('+', $conf->global->{$confkey});
}
$curentInput = (empty($inputCount)?1:($inputCount+1));
$formSelectInvoiceType = $form->selectarray('value'. $curentInput, $arrayAvailableType, $selected, 1);
$curentInput = (empty($inputCount) ? 1 : ($inputCount + 1));
$formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1);
_printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType);
//_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituation'));
@ -126,7 +126,7 @@ $metas = array(
_printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans('RetainedwarrantyDefaultPercent'), '', $metas);
// Conditions paiements
$inputCount = empty($inputCount)?1:($inputCount+1);
$inputCount = empty($inputCount) ? 1 : ($inputCount + 1);
print '<tr class="oddeven">';
print '<td>'.$langs->trans('PaymentConditionsShortRetainedWarranty').'</td>';
print '<td class="center" width="20">&nbsp;</td>';
@ -178,7 +178,7 @@ function _printOnOff($confkey, $title = false, $desc = '')
global $langs;
print '<tr class="oddeven">';
print '<td>'.($title?$title:$langs->trans($confkey));
print '<td>'.($title ? $title : $langs->trans($confkey));
if (!empty($desc)) {
print '<br><small>'.$langs->trans($desc).'</small>';
}
@ -206,14 +206,14 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra
{
global $langs, $conf, $db, $inputCount;
$inputCount = empty($inputCount)?1:($inputCount+1);
$form=new Form($db);
$inputCount = empty($inputCount) ? 1 : ($inputCount + 1);
$form = new Form($db);
$defaultMetas = array(
'name' => 'value'.$inputCount
);
if ($type!='textarea') {
if ($type != 'textarea') {
$defaultMetas['type'] = 'text';
$defaultMetas['value'] = $conf->global->{$confkey};
}
@ -229,9 +229,9 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra
print '<td>';
if (!empty($help)) {
print $form->textwithtooltip(($title?$title:$langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, ''));
print $form->textwithtooltip(($title ? $title : $langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, ''));
} else {
print $title?$title:$langs->trans($confkey);
print $title ? $title : $langs->trans($confkey);
}
if (!empty($desc)) {
@ -244,12 +244,12 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra
print '<input type="hidden" name="param'.$inputCount.'" value="'.$confkey.'">';
print '<input type="hidden" name="action" value="setModuleOptions">';
if ($type=='textarea') {
if ($type == 'textarea') {
print '<textarea '.$metascompil.' >'.dol_htmlentities($conf->global->{$confkey}).'</textarea>';
}elseif($type=='input'){
}elseif ($type == 'input') {
print '<input '.$metascompil.' />';
}
else{
else {
// custom
print $type;
}

View File

@ -122,6 +122,10 @@ if ($action == 'update')
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $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()))));
if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity);
else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity);
@ -160,7 +164,6 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities
@ -278,8 +281,10 @@ print '</tr>';
// Disable javascript and ajax
print '<tr class="oddeven"><td>'.$langs->trans("DisableJavascript").'</td><td>';
print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
print ' <span class="opacitymedium"> &nbsp; &nbsp; '.$langs->trans("DisableJavascriptNote").'</span>';
print '</td>';
print '<td>';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Max size of lists
@ -392,6 +397,13 @@ print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage
print '<th width="20">&nbsp;</th>';
print '</tr>';
// Hide helpcenter link on login page
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Message on login page
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount', 'user'));
complete_substitutions_array($substitutionarray, $langs);
@ -407,13 +419,6 @@ $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf
$doleditor->Create();
print '</td></tr>'."\n";
// Hide helpcenter link on login page
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK) ? $conf->global->MAIN_HELPCENTER_DISABLELINK : 0, 1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Background
print '<tr class="oddeven"><td><label for="imagebackground">'.$langs->trans("BackgroundImageLogin").' (png,jpg)</label></td><td colspan="2">';
print '<div class="centpercent inline-block">';

View File

@ -67,12 +67,12 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE))
}
}
print '<span class="opacitymedium">';
print $langs->trans("SetupDescription1");
print '<span class="opacitymedium hideonsmartphone">';
print $langs->trans("SetupDescription1").' ';
print $langs->trans("AreaForAdminOnly").' ';
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"));
print '</span>';
print "<br><br>";
print '</span>';
print '<br>';

View File

@ -536,7 +536,7 @@ $errors = $hookmanager->errors;
// Line to enter new values (input fields)
print "<tr ".$bcnd[$var].">";
print '<tr class="oddeven">';
if (empty($reshook))
{
@ -976,12 +976,9 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
{
global $conf, $langs, $user, $db;
global $form;
global $region_id;
global $elementList, $sourceList, $localtax_typeList;
global $bc;
global $elementList, $sourceList;
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
foreach ($fieldlist as $field => $value)
{

View File

@ -277,8 +277,8 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("TreeMenuPersonalized").'</td>';
print '<td class="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'object_category').' '.$langs->trans("UndoExpandAll").'</a>';
print ' | <a href="#">'.img_picto('', 'object_category-expanded').' '.$langs->trans("ExpandAll").'</a></div></td>';
print '<td class="right"><div id="iddivjstreecontrol"><a href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a>';
print ' | <a href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a></div></td>';
print '</tr>';
print '<tr>';
@ -325,6 +325,22 @@ if ($conf->use_javascript_ajax)
if (!empty($menu['langs'])) $langs->load($menu['langs']);
$titre = $langs->trans($menu['titre']);
$entry = '<table class="nobordernopadding centpercent"><tr><td>';
$entry .= '<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>';
$entry .= '</td><td class="right">';
$entry .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
$entry .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
$entry .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
$entry .= '&nbsp; &nbsp; &nbsp;';
$entry .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
$entry .= '</td></tr></table>';
$buttons = '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
$buttons .= '<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
$buttons .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
$buttons .= '&nbsp; &nbsp; &nbsp;';
$buttons .= '<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
$data[] = array(
'rowid'=>$menu['rowid'],
'module'=>$menu['module'],
@ -335,20 +351,8 @@ if ($conf->use_javascript_ajax)
'fk_mainmenu'=>$menu['fk_mainmenu'],
'fk_leftmenu'=>$menu['fk_leftmenu'],
'position'=>$menu['position'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
'</td><td class="right">'.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
'&nbsp; &nbsp; &nbsp;'.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>'.
'</td></tr></table>',
'buttons'=>'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> '.
'<a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> '.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> '.
'&nbsp; &nbsp; &nbsp;'.
'<a href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>'
'entry'=>$entry,
'buttons'=>$buttons
);
$i++;
}

View File

@ -387,7 +387,7 @@ if ($mode == 'feature')
$filedata = dol_buildpath($moduledir.'/sql/data.sql');
if (dol_is_file($filedata))
{
$text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql'.')';
$text .= $langs->trans("Yes").' ('.$moduledir.'/sql/data.sql)';
}
else $text .= $langs->trans("No");

View File

@ -412,11 +412,13 @@ foreach ($modulesdir as $dir)
}
$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
//var_dump($familyposition);
//$familyposition += 100;
// 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).
if (is_numeric($familyposition)) {
$familyposition = sprintf("%03d", (int) $familyposition + 100);
}
}
$orders[$i] = $familyposition."_".$familykey."_".$moduleposition."_".$j; // Sort by family, then by module position then number
@ -678,7 +680,9 @@ if ($mode == 'common' || $mode == 'commonkanban')
if (preg_match('/development/i', $version)) $versiontrans .= img_warning($langs->trans("Development"), 'style="float: left"');
if (preg_match('/experimental/i', $version)) $versiontrans .= img_warning($langs->trans("Experimental"), 'style="float: left"');
if (preg_match('/deprecated/i', $version)) $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"');
$versiontrans .= $objMod->getVersion(1);
if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
$versiontrans .= $objMod->getVersion(1);
}
// Define imginfo
$imginfo = "info";

View File

@ -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'));
// Security check
if (!$user->admin)
accessforbidden();
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
$error = 0;
/*
@ -45,27 +47,48 @@ $action = GETPOST('action', 'aZ09');
*/
// Action to update or add a constant
if ($action == 'update' || $action == 'add')
if ($action == 'settemplates')
{
$constlineid = GETPOST('rowid', 'int');
$constname=GETPOST('constname', 'alpha');
$db->begin();
$constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue'));
$consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype'));
$constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote'));
$typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype];
$res=dolibarr_set_const($db, $constname, $constvalue, $typetouse, 0, $constnote, $conf->entity);
if (! $res > 0) $error++;
if (! $error)
if (!$error && is_array($_POST))
{
$reg = array();
foreach ($_POST as $key => $val)
{
if (!preg_match('/^constvalue_(.*)_TEMPLATE/', $key, $reg)) continue;
$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);
}
}
}
if (!$error)
{
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@ -74,12 +97,31 @@ if ($action == 'setvalue' && $user->admin)
{
$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 (!$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))
{
//var_dump($_POST);
$reg = array();
foreach ($_POST as $key => $val)
{
@ -101,7 +143,7 @@ if ($action == 'setvalue' && $user->admin)
}
elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg))
{
// Add a new entry
// Add a new entry
$newkey = 'NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
$newval = GETPOST($shortkey.'_key');
}
@ -168,9 +210,18 @@ print '</td>';
print '</tr>';
print '</table>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print '</form>';
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
$title = $langs->trans("ListOfNotificationsPerUser");
if (!empty($conf->societe->enabled)) $title = $langs->trans("ListOfNotificationsPerUserOrContact");
@ -183,7 +234,7 @@ $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
// Editing global variables not related to a specific theme
$constantes=array();
$constantes = array();
foreach ($listofnotifiedevents as $notifiedevent)
{
$label = $langs->trans("Notify_".$notifiedevent['code']); //!=$langs->trans("Notify_".$notifiedevent['code'])?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label'];
@ -210,8 +261,8 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
$constantes[$notifiedevent['code'].'_TEMPLATE'] = array('type'=>'emailtemplate:'.$model, 'label'=>$label);
}
$helptext='';
form_constantes($constantes, 0, $helptext);
$helptext = '';
form_constantes($constantes, 2, $helptext);
} else {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
@ -248,14 +299,18 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '</table>';
}
print '<div class="opacitymedium">';
print '* '.$langs->trans("GoOntoUserCardToAddMore").'<br>';
if (!empty($conf->societe->enabled)) print '** '.$langs->trans("GoOntoContactCardToAddMore").'<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print '</form>';
print '</div>';
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 '<table class="noborder centpercent">';
@ -265,7 +320,7 @@ print '<td>'.$langs->trans("Code").'</td>';
print '<td>'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("FixedEmailTarget").'</td>';
print '<td>'.$langs->trans("Threshold").'</td>';
print '<td>'.'</td>';
print '<td></td>';
print "</tr>\n";
foreach ($listofnotifiedevents as $notifiedevent)
@ -333,6 +388,12 @@ foreach ($listofnotifiedevents as $notifiedevent)
}
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 '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2015 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
* it under the terms of the GNU General Public License as published by
@ -70,11 +71,12 @@ if ($action == 'setmod')
if ($action == 'setparams')
{
$freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'none'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
$res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($error)
{
setEventMessages($langs->trans("Error"), null, 'errors');
@ -253,6 +255,14 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $co
print '</td><td class="right">';
print "</td></tr>\n";
// Allow to group payments by mod in rapports
print '<tr class="oddeven"><td>';
print $langs->trans("GroupPaymentsByModOnReports");
print '</td><td width="60" align="center">';
print $form->selectyesno("PAYMENTS_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_REPORT_GROUP_BY_MOD, 1);
print '</td><td class="right">';
print "</td></tr>\n";
print '</table>';
print '</div>';

View File

@ -168,9 +168,9 @@ elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
exit;
}
if ($action == 'maj_pattern')
if ($action == 'updatepattern')
{
$pattern = GETPOST("pattern");
$pattern = GETPOST("pattern", "alpha");
$explodePattern = explode(';', $pattern);
$patternInError = false;
@ -184,6 +184,7 @@ if ($action == 'maj_pattern')
if (!$patternInError) {
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: security.php");
exit;
}
@ -336,11 +337,9 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
print '</table>';
print '<br>';
print '<table class="right">';
print '<tr><td>';
print '<div class="center">';
print '<a class="button" id="linkChangePattern">'.$langs->trans("Save").'</a>';
print '</td></tr>';
print '</table>';
print '</div>';
print '<br><br>';
print '<script type="text/javascript">';
@ -369,10 +368,11 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
print ' }';
print ' function generatelink(){';
print ' return "security.php?action=maj_pattern&pattern="+getStringArg();';
print ' return "security.php?action=updatepattern&pattern="+getStringArg();';
print ' }';
print ' function valuePatternChange(){';
print ' console.log("valuePatternChange");';
print ' var lang_save = "'.$langs->trans("Save").'";';
print ' var lang_error = "'.$langs->trans("Error").'";';
print ' var lang_Disabled = "'.$langs->trans("Disabled").'";';

View File

@ -138,7 +138,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("AntiVirusCommand").'<br>';
print $langs->trans("AntiVirusCommandExample");
print '<span class="opacitymedium">'.$langs->trans("AntiVirusCommandExample").'</span>';
// Check command in inside safe_mode
print '</td>';
print '<td>';
@ -161,7 +161,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
print $langs->trans("AntiVirusParamExample");
print '<span class="opacitymedium">'.$langs->trans("AntiVirusParamExample").'</span>';
print '</td>';
print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_PARAM) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_PARAM) : '').'">';

View File

@ -177,7 +177,11 @@ $sessiontimeout = ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
print '<tr class="oddeven">';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td class="right">';
print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor")));
if (ini_get("session.gc_probability") == 0) {
print $form->textwithpicto('', $langs->trans("SessionsPurgedByExternalSystem", ini_get("session.gc_maxlifetime")));
} else {
print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"), ini_get("session.gc_maxlifetime")));
}
print '</td>';
print '<td class="nowrap">';
print '<input class="flat" name="MAIN_SESSION_TIMEOUT" type="text" size="6" value="'.htmlentities($conf->global->MAIN_SESSION_TIMEOUT).'"> '.strtolower($langs->trans("Seconds"));
@ -185,7 +189,6 @@ print '</td>';
print '</tr>';
$sessiontimeout = ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = "";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
*
* 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
@ -144,6 +145,23 @@ elseif ($action == 'specimen')
}
}
elseif ($action == 'setparams')
{
$res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if ($error)
{
setEventMessages($langs->trans("Error"), null, 'errors');
}
if (!$error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
}
/*
* View
*/
@ -428,8 +446,46 @@ foreach ($dirmodels as $reldir)
print '</table>';
/*
* Other Options
*/
print "<br>";
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="action" value="setparams" />';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print '<td width="80">&nbsp;</td>';
print "</tr>\n";
// Allow to group payments by mod in rapports
print '<tr class="oddeven"><td>';
print $langs->trans("GroupPaymentsByModOnReports");
print '</td><td width="60" align="center">';
print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD, 1);
print '</td><td class="right">';
print "</td></tr>\n";
print '</table>';
dol_fiche_end();
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print '</div>';
print '<br>';
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -66,7 +66,7 @@ if ($test) print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled");
else
{
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
}
print '<br>';
@ -123,7 +123,7 @@ if (!$foundcache && $test)
{
$foundcache++;
print img_picto('', 'tick.png').' '.$langs->trans("PHPModuleLoaded", "XCache");
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php'.'">Xcache admin page</a>';
print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xcache.php">Xcache admin page</a>';
}
$test = function_exists('eaccelerator_info');
if (!$foundcache && $test)

View File

@ -143,7 +143,7 @@ $loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td width="200">'.$langs->trans("Extension").'</td>';
print '<td align="center">'.$langs->trans("EnabledInSetup").'</td>';
//print '<td align="center">'.$langs->trans("EnabledInSetup").'</td>';
print '<td align="center">'.$langs->trans("Loaded").'</td>';
print '<td align="center">'.$langs->trans("FunctionTest").'</td>';
print '<td>'.$langs->trans("Result").'</td>';
@ -154,7 +154,7 @@ $name = "GD";
print "<tr>";
print "<td>".$name."</td>";
print getTableColumn($name, $activatedExtensions);
//print getTableColumn($name, $activatedExtensions);
print getTableColumn($name, $loadedExtensions);
print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
@ -165,7 +165,7 @@ $name = "Curl";
print "<tr>";
print "<td>".$name."</td>";
print getTableColumn($name, $activatedExtensions);
//print getTableColumn($name, $activatedExtensions);
print getTableColumn($name, $loadedExtensions);
print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
@ -178,7 +178,7 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
print "<tr>";
print "<td>".$name."</td>";
print getTableColumn($name, $activatedExtensions);
//print getTableColumn($name, $activatedExtensions);
print getTableColumn($name, $loadedExtensions);
print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
@ -191,7 +191,7 @@ $name = "xDebug";
print "<tr>";
print "<td>".$name."</td>";
print getTableColumn($name, $activatedExtensions);
//print getTableColumn($name, $activatedExtensions);
print getTableColumn($name, $loadedExtensions);
print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
@ -208,7 +208,6 @@ foreach ($phparray as $key => $value)
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
//print '<td width="220px">'.$langs->trans("Parameter").'</td>';
print '<td width="220px">'.$key.'</td>';
print '<td colspan="2">'.$langs->trans("Value").'</td>';
print "</tr>\n";
@ -408,7 +407,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
global $langs;
$result = true;
$result = $result && in_array(strtolower($name), $activated);
//$result = $result && in_array(strtolower($name), $activated);
$result = $result && in_array(strtolower($name), $loaded);
foreach ($functions as $function)

View File

@ -200,7 +200,6 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<div class="formelementrow">';
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" />';
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
print '</div>';
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
@ -303,7 +302,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<br>';
print '<fieldset><legend>'.$langs->trans('ExportStructure').'</legend>';
print '<input type="checkbox" name="nobin_drop"'.((!isset($_GET["nobin_drop"]) && !isset($_POST["nobin_drop"])) || GETPOST('nobin_drop')) ? ' checked' : ''.' id="checkbox_dump_drop" />';
print '<input type="checkbox" name="nobin_drop"'.((! GETPOSTISSET("nobin_drop") || GETPOST('nobin_drop')) ? ' checked' : '').' id="checkbox_dump_drop" />';
print '<label for="checkbox_dump_drop">'.$langs->trans("AddDropTable").'</label>';
print '<br>';
print '</fieldset>';

View File

@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz')))
$file .= '.tar';
// We also exclude '/temp/' dir and 'documents/admin/documents'
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$result = $utils->executeCLI($cmd, $outputfile);

View File

@ -78,7 +78,7 @@ $form = new Form($db);
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>';

View File

@ -365,9 +365,9 @@ if ($mode == 'overwrite')
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print ' &nbsp; ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
}
print '</td>';
@ -531,8 +531,8 @@ if ($mode == 'searchkey')
{
$obj = $db->fetch_object($result);
}
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=edit">'.img_edit().'</a>';
print '&nbsp;&nbsp;';
print '<a class="editfielda reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=edit">'.img_edit().'</a>';
print ' ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=delete">'.img_delete().'</a>';
print '&nbsp;&nbsp;';
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
@ -541,7 +541,7 @@ if ($mode == 'searchkey')
elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
{
//print $key.'-'.$val;
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&amp;langcode='.$langcode.'&amp;transkey='.$key.'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&amp;langcode='.$langcode.'&amp;transkey='.$key.'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
}
if (!empty($conf->global->MAIN_FEATURES_LEVEL))

View File

@ -177,6 +177,30 @@ else
}
print '</td></tr>';
// user hide inactive
print '<tr class="oddeven">';
print '<td>'.$langs->trans("UserHideInactive").'</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX');
}
else
{
if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_USER_HIDE_INACTIVE_IN_COMBOBOX">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_USER_HIDE_INACTIVE_IN_COMBOBOX">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
}
}
print '</td></tr>';
print '</table>';
print '<br>';

View File

@ -85,11 +85,11 @@ $workflowcodes = array(
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify_order', 'position'=>41, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order', 'warning'=>''), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card.
'separator2'=>array('family'=>'separator', 'position'=>50),
// Automatic classification supplier proposal
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'propal', 'warning'=>''),
'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL'=>array('family'=>'classify_supplier_proposal', 'position'=>60, 'enabled'=>'! empty($conf->supplier_proposal->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'propal', 'warning'=>''),
// Automatic classification supplier order
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'! empty($conf->fournisseur->enabled)', 'picto'=>'order', 'warning'=>''),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array('family'=>'classify_supplier_order', 'position'=>62, 'enabled'=>'!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)', 'picto'=>'order', 'warning'=>''),
//Automatic classification reception
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && ! empty($conf->fournisseur->enabled)', 'picto'=>'bill'),
'WORKFLOW_BILL_ON_RECEPTION'=>array('family'=>'classify_reception', 'position'=>64, 'enabled'=>'! empty($conf->reception->enabled) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', 'picto'=>'bill'),
);
if (!empty($conf->modules_parts['workflow']) && is_array($conf->modules_parts['workflow']))

View File

@ -153,7 +153,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
// Show message
$message = '';
$url = $urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
$message .= $langs->trans("UrlToGetKeyToUseAPIs").':<br>';
$message .= '<span class="opacitymedium">'.$langs->trans("UrlToGetKeyToUseAPIs").':</span><br>';
$message .= img_picto('', 'globe').' '.$url;
print $message;
print '<br>';

View File

@ -137,6 +137,15 @@ class DolibarrApi
unset($object->labelStatus);
unset($object->labelStatusShort);
unset($object->stats_propale);
unset($object->stats_commande);
unset($object->stats_contrat);
unset($object->stats_facture);
unset($object->stats_commande_fournisseur);
unset($object->stats_reception);
unset($object->stats_mrptoconsume);
unset($object->stats_mrptoproduce);
unset($object->element);
unset($object->fk_element);
unset($object->table_element);

View File

@ -18,7 +18,7 @@
// Create the autoloader for Luracast
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function() {
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;

View File

@ -1409,15 +1409,15 @@ class Setup extends DolibarrApi
*
* Note that conf variables that stores security key or password hashes can't be loaded with API.
*
* @url GET /conf
*
* @param string $confname Name of conf variable to get
* @param string $constantname Name of conf variable to get
* @return array|mixed Data without useless information
*
* @url GET conf/{constantname}
*
* @throws RestException 403 Forbidden
* @throws RestException 500 Error Bad or unknown value for constname
* @throws RestException 500 Error Bad or unknown value for constantname
*/
public function getConf($confname)
public function getConf($constantname)
{
global $conf;
@ -1426,14 +1426,14 @@ class Setup extends DolibarrApi
throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK');
}
if (!preg_match('/^[a-zA-Z0-9_]+$/', $confname) || !isset($conf->global->$confname)) {
throw new RestException(500, 'Error Bad or unknown value for constname');
if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || !isset($conf->global->$constantname)) {
throw new RestException(500, 'Error Bad or unknown value for constantname');
}
if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) {
if (preg_match('/(_pass|_pw|password|secret|_key|key$)/i', $constantname)) {
throw new RestException(403, 'Forbidden');
}
return $conf->global->$confname;
return $conf->global->$constantname;
}
/**

View File

@ -44,7 +44,7 @@ if (!$res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
call_user_func(function() {
call_user_func(function () {
$loader = Luracast\Restler\AutoLoader::instance();
spl_autoload_register($loader);
return $loader;

View File

@ -34,15 +34,18 @@ $langs->loadLangs(array("asset"));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
// Initialize technical objects
$object = new Asset($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->asset->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('assetcard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -59,23 +62,20 @@ foreach ($object->fields as $key => $val)
if (empty($action) && empty($id) && empty($ref)) $action = 'view';
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'asset', $id);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$permissiontoread = $user->rights->asset->read;
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->asset->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->asset->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->asset->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1];
/*
* Actions
*
* Put here all code to do according to value of "action" parameter
*/
$parameters = array();
@ -86,16 +86,35 @@ if (empty($reshook))
{
$error = 0;
$permissiontoadd = $user->rights->asset->create;
$permissiontodelete = $user->rights->asset->delete;
$backurlforlist = dol_buildpath('/asset/list.php', 1);
// Actions cancel, add, update or delete
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Action to move up and down lines of object
//include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
// Action to build doc
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
if ($action == 'set_thirdparty' && $permissiontoadd)
{
$object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MYOBJECT_MODIFY');
}
if ($action == 'classin' && $permissiontoadd)
{
$object->setProject(GETPOST('projectid', 'int'));
}
// Actions to send emails
$triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
@ -143,11 +162,12 @@ if ($action == 'create')
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
dol_fiche_head(array(), '');
print '<table class="border centpercent">'."\n";
print '<table class="border centpercent tableforfieldcreate">'."\n";
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
@ -166,6 +186,8 @@ if ($action == 'create')
print '</div>';
print '</form>';
//dol_set_focus('input[name="ref"]');
}
// Part to edit record
@ -178,10 +200,12 @@ if (($id || $ref) && $action == 'edit')
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($backtopage) print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
if ($backtopageforcancel) print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
dol_fiche_head();
print '<table class="border centpercent">'."\n";
print '<table class="border centpercent tableforfieldedit">'."\n";
// Common attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
@ -206,7 +230,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$res = $object->fetch_optionals();
$head = asset_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, 'generic');
dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto);
$formconfirm = '';
@ -255,10 +279,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswithonsecondcolumn';
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just after this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_soc']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Other attributes
// Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';
@ -266,7 +292,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</div>';
print '</div>';
print '<div class="clearboth"></div><br>';
print '<div class="clearboth"></div>';
dol_fiche_end();
@ -349,14 +375,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
//Select mail models is same action as presend
/*
if (GETPOST('modelselected')) $action = 'presend';
// Presend form
$modelmail='inventory';
/*
$modelmail='asset';
$defaulttopic='InformationMessage';
$diroutput = $conf->product->dir_output.'/inventory';
$trackid = 'stockinv'.$object->id;
$diroutput = $conf->asset->dir_output.'/asset';
$trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
*/

View File

@ -77,12 +77,12 @@ class Asset extends CommonObject
*/
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object",),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text",),
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>1),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1),
'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",),
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty",),
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),

View File

@ -202,7 +202,7 @@ class AssetType extends CommonObject
$action = 'update';
// Actions on extra fields
if (! $error)
if (!$error)
{
$result = $this->insertExtraFields();
if ($result < 0)

View File

@ -223,20 +223,20 @@ if ($action === 'downloadblockchain') {
{
$statusofrecordnote = $langs->trans("PreviousFingerprint").': '.$previoushash.($statusofrecordnote ? ' - '.$statusofrecordnote : '');
}
print $obj->rowid
.';'.$obj->date_creation
.';"'.$obj->user_fullname.'"'
.';'.$obj->action
.';'.$obj->element
.';'.$obj->amounts
.';'.$obj->fk_object
.';'.$obj->date_object
.';"'.$obj->ref_object.'"'
.';'.$obj->signature
.';'.$statusofrecord
.';'.$statusofrecordnote
.';"'.str_replace('"', '""', $obj->object_data).'"'
."\n";
print $obj->rowid;
print ';'.$obj->date_creation;
print ';"'.str_replace('"', '""', $obj->user_fullname).'"';
print ';'.$obj->action;
print ';'.$obj->element;
print ';'.$obj->amounts;
print ';'.$obj->fk_object;
print ';'.$obj->date_object;
print ';"'.str_replace('"', '""', $obj->ref_object).'"';
print ';'.$obj->signature;
print ';'.$statusofrecord;
print ';'.$statusofrecordnote;
print ';"'.str_replace('"', '""', $obj->object_data).'"';
print "\n";
// Set new previous hash for next fetch
$previoushash = $obj->signature;

View File

@ -44,26 +44,26 @@ $signature = GETPOST('s');
$newblock = GETPOST('b');
$hash = GETPOST('h');
if($auth->fetch(0, $signature)<=0) {
if ($auth->fetch(0, $signature) <= 0) {
$auth->signature = $signature;
$auth->create($user);
}
if(!empty($hash)) {
if (!empty($hash)) {
echo $auth->checkBlockchain($hash) ? 'hashisok' : 'hashisjunk';
}
elseif(!empty($newblock)){
if($auth->checkBlock($newblock)) {
elseif (!empty($newblock)) {
if ($auth->checkBlock($newblock)) {
$auth->addBlock($newblock);
$auth->update($user);
echo 'blockadded';
}
else{
else {
echo 'blockalreadyadded';
}
}
else{
else {
echo 'idontunderstandwhatihavetodo';
}

View File

@ -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)
*/
//public function doScheduledJob($param1, $param2, ...)
public function doScheduledJob()
{
global $conf, $langs;
@ -1005,6 +1004,7 @@ class BOM extends CommonObject
/**
* BOM costs calculation based on cost_price or pmp of each BOM line
*
* @return void
*/
public function calculateCosts()
@ -1023,7 +1023,9 @@ class BOM extends CommonObject
}
$this->total_cost = price2num($this->total_cost, 'MT');
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
}
}
}

View File

@ -79,7 +79,7 @@ function bomPrepareHead($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("BOM");
$head[$h][2] = 'card';
$h++;

View File

@ -42,7 +42,7 @@ $ilink = 0;
foreach ($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$product_static= new Product($db);
$product_static = new Product($db);
$trclass = 'oddeven';
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass .= ' liste_sub_total';
echo '<tr class="'.$trclass.'" >';

View File

@ -74,7 +74,7 @@ if ($nolinesbefore) {
print '<td class="linecoledit" colspan="'.$colspan.'">&nbsp;</td>';
print '</tr>';
}
print '<tr class="pair nodrag nodrop nohoverpair'.($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create'.'">';
print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create').'">';
$coldisplay = 0;
// Adds a line numbering column

View File

@ -60,7 +60,7 @@ function printDropdownBookmarksList()
}
$searchForm = '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? 'onsubmit="return false"' : '').'>';
$searchForm .= '<form id="top-menu-action-bookmark" name="actionbookmark" method="POST" action=""'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ' onsubmit="return false"' : '').'>';
$searchForm .= '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -135,7 +135,7 @@ $head = array();
$h = 1;
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? 'id='.$object->id : '');
$head[$h][1] = $langs->trans("Card");
$head[$h][1] = $langs->trans("Bookmark");
$head[$h][2] = 'card';
$h++;

View File

@ -8,7 +8,7 @@ CACHE MANIFEST
# Files listed under CACHE will be ALWAYS cached after they are loaded.
# And they will be always used from Cache after (even after refresh).
CACHE:
theme/dolibarr_logo.png
theme/dolibarr_logo.svg
support/
support/index.php

View File

@ -32,23 +32,23 @@
* View
*/
$form=new Form($db);
$form = new Form($db);
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
if ( GETPOST('filtre', 'alpha') ) {
if (GETPOST('filtre', 'alpha')) {
// Avec filtre
$ret=array(); $i=0;
$ret = array(); $i = 0;
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql.= " WHERE p.entity IN (".getEntity('product').")";
$sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
$sql.= " AND (";
$sql.= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
if (! empty($conf->barcode->enabled))
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql .= " WHERE p.entity IN (".getEntity('product').")";
$sql .= " AND p.tosell = 1";
if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0";
$sql .= " AND (";
$sql .= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
if (!empty($conf->barcode->enabled))
{
$filtre = GETPOST('filtre', 'alpha');
@ -85,23 +85,23 @@ if ( GETPOST('filtre', 'alpha') ) {
{
dol_print_error($db);
}
$tab_designations=$ret;
$tab_designations = $ret;
} else {
// Sans filtre
$ret=array();
$i=0;
$ret = array();
$i = 0;
$sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql.= " WHERE p.entity IN (".getEntity('product').")";
$sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
$sql.= " ORDER BY p.label";
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= ", ps.reel";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
$sql .= " WHERE p.entity IN (".getEntity('product').")";
$sql .= " AND p.tosell = 1";
if (!$conf->global->CASHDESK_SERVICES) $sql .= " AND p.fk_product_type = 0";
$sql .= " ORDER BY p.label";
dol_syslog($sql);
$resql=$db->query($sql);
$resql = $db->query($sql);
if ($resql)
{
$nbr_enreg = $db->num_rows($resql);

View File

@ -184,9 +184,7 @@ foreach ($fulltree as $key => $val)
'rowid'=>$val['rowid'],
'fk_menu'=>$val['fk_parent'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.$counter.
//'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
'</tr></table>'
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td></tr></table>'
);
}

View File

@ -735,7 +735,7 @@ if ($type == Categorie::TYPE_CONTACT)
$num = count($contacts);
$nbtotalofrecords = '';
$newcardbutton = '';
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contacts', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("Contact"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'contact', 0, $newcardbutton, '', $limit);
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Ref").'</td></tr>'."\n";
@ -989,7 +989,7 @@ if ($type == Categorie::TYPE_WAREHOUSE)
print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit);
print_barre_liste($langs->trans("Warehouses"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'stock', 0, $newcardbutton, '', $limit);
print "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";

View File

@ -317,7 +317,7 @@ if (empty($reshook) && $action == 'add')
if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int");
}
$object->note = trim(GETPOST("note"));
$object->note_private = trim(GETPOST("note"));
if (isset($_POST["contactid"])) $object->contact = $contact;
@ -465,7 +465,6 @@ if (empty($reshook) && $action == 'update')
$object->contactid = key($object->socpeopleassigned);
}
$object->fk_project = GETPOST("projectid", 'int');
$object->note = GETPOST("note", "none"); // deprecated
$object->note_private = GETPOST("note", "none");
$object->fk_element = GETPOST("fk_element", "int");
$object->elementtype = GETPOST("elementtype", "alphanohtml");
@ -1122,7 +1121,7 @@ if ($action == 'create')
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%');
$doleditor->Create();
print '</td></tr>';
@ -1188,7 +1187,7 @@ if ($id > 0)
$object->contactid = GETPOST("contactid", 'int');
$object->fk_project = GETPOST("projectid", 'int');
$object->note = GETPOST("note", 'none');
$object_private = GETPOST("note", 'none');
}
if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
@ -1540,7 +1539,7 @@ if ($id > 0)
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor = new DolEditor('note', $object->note, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor = new DolEditor('note', $object->note_private, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor->Create();
print '</td></tr>';

View File

@ -380,7 +380,7 @@ class ActionComm extends CommonObject
// Clean parameters
$this->label = dol_trunc(trim($this->label), 128);
$this->location = dol_trunc(trim($this->location), 128);
$this->note = dol_htmlcleanlastbr(trim($this->note));
$this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private));
if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0;
@ -405,7 +405,6 @@ class ActionComm extends CommonObject
$this->userassigned[$tmpid] = array('id'=>$tmpid, 'transparency'=>$this->transparency);
}
$userownerid = $this->userownerid;
$userdoneid = $this->userdoneid;
@ -484,11 +483,11 @@ class ActionComm extends CommonObject
$sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", ";
$sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated
$sql .= (isset($this->type_id) ? $this->type_id : "null").",";
$sql .= ($code ? ("'".$code."'") : "null").", ";
$sql .= ($code ? ("'".$this->db->escape($code)."'") : "null").", ";
$sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", ";
$sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", ";
$sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", ";
$sql .= " '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."', ";
$sql .= " '".$this->db->escape($this->note_private)."', ";
$sql .= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid : "null").", ";
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
@ -680,6 +679,7 @@ class ActionComm extends CommonObject
$sql = "SELECT a.id,";
$sql .= " a.id as ref,";
$sql .= " a.entity,";
$sql .= " a.ref_ext,";
$sql .= " a.datep,";
$sql .= " a.datep2,";
@ -716,6 +716,7 @@ class ActionComm extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id = $obj->id;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext;
@ -730,14 +731,14 @@ class ActionComm extends CommonObject
$this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : '');
$this->code = $obj->code;
$this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep);
$this->datef = $this->db->jdate($obj->datep2);
$this->label = $obj->label;
$this->datep = $this->db->jdate($obj->datep);
$this->datef = $this->db->jdate($obj->datep2);
$this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem);
$this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem);
$this->note = $obj->note;
$this->note = $obj->note; // deprecated
$this->note_private = $obj->note;
$this->percentage = $obj->percentage;
@ -990,7 +991,7 @@ class ActionComm extends CommonObject
// Clean parameters
$this->label = trim($this->label);
$this->note = trim($this->note);
$this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private));
if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->transparency)) $this->transparency = 0;
@ -1024,7 +1025,7 @@ class ActionComm extends CommonObject
$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
$sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape($this->durationp)."'" : "null"); // deprecated
$sql .= ", note = '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."'";
$sql .= ", note = '".$this->db->escape($this->note_private)."'";
$sql .= ", fk_project =".($this->fk_project > 0 ? $this->fk_project : "null");
$sql .= ", fk_soc =".($socid > 0 ? $socid : "null");
$sql .= ", fk_contact =".($contactid > 0 ? $contactid : "null");
@ -1403,8 +1404,8 @@ class ActionComm extends CommonObject
$tooltip .= '<br><b>'.$langs->trans('Type').':</b> '.$labeltype;
if (!empty($this->location))
$tooltip .= '<br><b>'.$langs->trans('Location').':</b> '.$this->location;
if (!empty($this->note))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note) ? str_replace(array("\r", "\n"), "", $this->note) : str_replace(array("\r", "\n"), '<br>', $this->note));
if (!empty($this->note_private))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '<br>', $this->note_private));
$linkclose = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"';
@ -1937,8 +1938,7 @@ class ActionComm extends CommonObject
$this->location = 'Location';
$this->transparency = 1; // 1 means opaque
$this->priority = 1;
$this->note = "This is a 'public' note";
$this->note_public = "This is a 'public' note.";
//$this->note_public = "This is a 'public' note.";
$this->note_private = "This is a 'private' note.";
$this->userownerid = $user->id;

View File

@ -166,12 +166,12 @@ class CActionComm
if ($qualified && $obj->module)
{
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified = 0;
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified = 0;
if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified = 0;
if ($obj->module == 'invoice_supplier' && !$conf->fournisseur->enabled) $qualified = 0;
if ($obj->module == 'order_supplier' && !$conf->fournisseur->enabled) $qualified = 0;
if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified = 0;
if ($obj->module == 'invoice' && !$conf->facture->enabled) $qualified=0;
if ($obj->module == 'order' && !$conf->commande->enabled) $qualified=0;
if ($obj->module == 'propal' && !$conf->propal->enabled) $qualified=0;
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_invoice->enabled)) $qualified=0;
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || ! $conf->supplier_order->enabled)) $qualified=0;
if ($obj->module == 'shipping' && !$conf->expedition->enabled) $qualified=0;
}
if ($qualified)

View File

@ -242,7 +242,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$sql = "SELECT";
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
$sql .= " a.id, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
@ -385,14 +385,8 @@ if ($resql)
print '<input type="hidden" name="type" value="'.$type.'">';
$nav = '';
//if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
//if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
if ($filter) $nav .= '<input type="hidden" name="search_filter" value="'.$filter.'">';
//if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
//if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
if ($showbirthday) $nav .= '<input type="hidden" name="search_showbirthday" value="1">';
//if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
//if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
print $nav;
dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
@ -548,13 +542,13 @@ if ($resql)
$actionstatic->id = $obj->id;
$actionstatic->ref = $obj->id;
$actionstatic->code = $obj->code;
$actionstatic->type_code = $obj->type_code;
$actionstatic->type_label = $obj->type_label;
$actionstatic->type_picto = $obj->type_picto;
$actionstatic->label = $obj->label;
$actionstatic->location = $obj->location;
$actionstatic->note = dol_htmlentitiesbr($obj->note); // deprecated
$actionstatic->note_public = dol_htmlentitiesbr($obj->note);
$actionstatic->note_private = dol_htmlentitiesbr($obj->note);
$actionstatic->fetchResources();
@ -584,21 +578,31 @@ if ($resql)
if (!empty($arrayfields['c.libelle']['checked']))
{
print '<td class="nowraponall">';
$actioncomm = $actionstatic;
// TODO Code common with code into showactions
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto);
else {
if ($actionstatic->type_code == 'AC_RDV') print img_picto('', 'object_group', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_TEL') print img_picto('', 'object_phoning', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_FAX') print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_EMAIL') print img_picto('', 'object_email', '', false, 0, 0, '', '').' ';
elseif ($actionstatic->type_code == 'AC_INT') print img_picto('', 'object_intervention', '', false, 0, 0, '', '').' ';
elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) print img_picto('', 'object_other', '', false, 0, 0, '', '').' ';
}
if ($actioncomm->type_picto) {
$imgpicto = img_picto('', $actioncomm->type_picto);
}
else {
if ($actioncomm->type_code == 'AC_RDV') $imgpicto = img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_EMAIL') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
elseif ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' ';
elseif (!preg_match('/_AUTO/', $actioncomm->type_code)) $imgpicto = img_picto('', 'object_other', '', false, 0, 0, '', 'paddingright').' ';
}
}
print $imgpicto;
$labeltype = $obj->type_code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype = 'AC_OTH';
if (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') {
$labeltype = $langs->trans("Message");
} elseif (!empty($arraylist[$labeltype])) $labeltype = $arraylist[$labeltype];
print dol_trunc($labeltype, 28);
print '</td>';
}
@ -613,15 +617,15 @@ if ($resql)
// Description
if (!empty($arrayfields['a.note']['checked'])) {
print '<td class="tdoverflowonsmartphone">';
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note, 0));
print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note);
$text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 0));
print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note_private);
print '</td>';
}
$formatToUse = $obj->fulldayevent ? 'day' : 'dayhour';
// Start date
if (!empty($arrayfields['a.datep']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->dp), $formatToUse);
$late = 0;
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) $late = 1;
@ -634,7 +638,7 @@ if ($resql)
// End date
if (!empty($arrayfields['a.datep2']['checked'])) {
print '<td class="center">';
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->dp2), $formatToUse);
print '</td>';
}
@ -718,7 +722,7 @@ if ($resql)
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;

View File

@ -5,7 +5,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2020 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@ -582,7 +582,7 @@ if ($object->id > 0)
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="border boxtable boxtablenobottom boxtablenotop" width="100%">';
$boxstat .= '<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
if (!empty($conf->propal->enabled))
if (!empty($conf->propal->enabled) && $user->rights->propal->lire)
{
// Box proposals
$tmp = $object->getOutstandingProposals();
@ -600,7 +600,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>';
}
if (!empty($conf->commande->enabled))
if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
{
// Box commandes
$tmp = $object->getOutstandingOrders();
@ -618,7 +618,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>';
}
if (!empty($conf->facture->enabled))
if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{
// Box factures
$tmp = $object->getOutstandingBills();

View File

@ -35,7 +35,7 @@ if (!empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/cl
if (!empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (!empty($conf->supplier_proposal->enabled)) require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (!empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if (!$user->rights->societe->lire) accessforbidden();
@ -76,7 +76,7 @@ $companystatic = new Societe($db);
if (!empty($conf->propal->enabled)) $propalstatic = new Propal($db);
if (!empty($conf->supplier_proposal->enabled)) $supplierproposalstatic = new SupplierProposal($db);
if (!empty($conf->commande->enabled)) $orderstatic = new Commande($db);
if (!empty($conf->fournisseur->enabled)) $supplierorderstatic = new CommandeFournisseur($db);
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) $supplierorderstatic = new CommandeFournisseur($db);
llxHeader("", $langs->trans("CommercialArea"));
@ -102,7 +102,7 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useles
$listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort');
}
// Search supplier order
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
{
$listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder');
}
@ -414,7 +414,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
/*
* Draft suppliers orders
*/
if (!empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire)
{
$langs->load("orders");
@ -581,7 +581,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
}
// Last suppliers
if (!empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire)
{
$langs->load("boxes");

View File

@ -147,15 +147,15 @@ if ($action == 'add') {
if (preg_match("/st_dt/", $key)) {
$dtarr = array();
$dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_st_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear'.'_cnct', 'int'));
if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int'));
}
} elseif (preg_match("/end_dt/", $key)) {
// Special case for end date come with 3 inputs day, month, year
$dtarr = array();
$dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_end_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear'.'_cnct', 'int'));
if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int'));
}
} else {
$array_query[$key] = GETPOST($key);
@ -299,15 +299,15 @@ if ($action == 'savefilter' || $action == 'createfilter') {
if (preg_match("/st_dt/", $key)) {
$dtarr = array();
$dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_st_dt'.'_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_st_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear'.'_cnct', 'int'));
if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int'));
}
} elseif (preg_match("/end_dt/", $key)) {
// Special case for end date come with 3 inputs day, month, year
$dtarr = array();
$dtarr = explode('_', $key);
if (!array_key_exists('options_'.$dtarr[1].'_end_dt'.'_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_end_dt'.'_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday'.'_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear'.'_cnct', 'int'));
if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) {
$array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int'));
// print $array_query['cnct_options_'.$dtarr[1].'_end_dt'];
// 01/02/1013=1361228400
}

View File

@ -742,7 +742,7 @@ if ($action == 'create')
// Print mail form
print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'generic');
print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email');
dol_fiche_head();

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