Merge branch 'develop' into patch-339

This commit is contained in:
Laurent Destailleur 2020-05-23 15:14:06 +02:00 committed by GitHub
commit 4913d10724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
219 changed files with 4557 additions and 3431 deletions

View File

@ -404,6 +404,10 @@ script:
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade11001200.log 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 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 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 # 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 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 $? echo $?

View File

@ -78,7 +78,7 @@ FIX: we must export company mail address on contact vcard only if contact email
FIX: when we filter a list on a view status, we want this filter to be on bookmark that we create 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 Sql on getListOfTowns api method
FIX: wrong user right's name to top menu "commercial" FIX: wrong user right's name to top menu "commercial"
FIX: XSS Vulnerability FIX: XSS Vulnerability reported by Mehmet Kelepçe / Gais Cyber Security
***** ChangeLog for 12.0.0 compared to 11.0.0 ***** ***** ChangeLog for 12.0.0 compared to 11.0.0 *****
For Users: For Users:

View File

@ -3,7 +3,7 @@ FROM php:7.2-apache
ENV HOST_USER_ID 33 ENV HOST_USER_ID 33
ENV PHP_INI_DATE_TIMEZONE 'UTC' ENV PHP_INI_DATE_TIMEZONE 'UTC'
RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev libzip-dev zlib1g-dev libicu-dev g++\ RUN apt-get update && apt-get install -y libpng16-16 libpng-dev libjpeg62-turbo libjpeg62-turbo-dev libldap2-dev zlib1g-dev libicu-dev g++\
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd \ && docker-php-ext-install gd \
@ -14,7 +14,7 @@ RUN apt-get update && apt-get install -y libpng-dev libjpeg-dev libldap2-dev lib
&& docker-php-ext-install calendar \ && docker-php-ext-install calendar \
&& docker-php-ext-configure intl \ && docker-php-ext-configure intl \
&& docker-php-ext-install intl \ && docker-php-ext-install intl \
&& apt-get autoremove --purge -y libjpeg-dev libldap2-dev zlib1g-dev libicu-dev g++ && apt-get autoremove --purge -y libpng-dev libjpeg62-turbo-dev libldap2-dev zlib1g-dev libicu-dev g++
RUN mkdir /var/documents RUN mkdir /var/documents
RUN chown www-data /var/documents RUN chown www-data /var/documents

View File

@ -21,5 +21,12 @@ web:
- ../../htdocs:/var/www/html - ../../htdocs:/var/www/html
links: links:
- mariadb - mariadb
- mail
ports: ports:
- "80:80" - "80:80"
mail:
image: maildev/maildev
ports:
- "8081:80"
- "25:25"

View File

@ -272,12 +272,7 @@
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" /> <rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle"> <rule ref="PEAR.Commenting.FunctionComment.WrongStyle" />
</rule>
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType"> <rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
<severity>0</severity> <severity>0</severity>
@ -310,20 +305,21 @@
<!-- Test if () are removed for includes --> <!-- Test if () are removed for includes -->
<rule ref="PEAR.Files.IncludingFile" /> <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"> <rule ref="PEAR.Files.IncludingFile.UseInclude">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if --> <!-- We disable this. We must be allowed to use strict require instead of non strict include anywhere -->
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce"> <rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Files.IncludingFile.UseRequire"> <rule ref="PEAR.Files.IncludingFile.UseRequire">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
<!-- We disable this: We want to allow include_once -->
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce"> <rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -332,27 +328,25 @@
<rule ref="PEAR.Functions.FunctionCallSignature" /> <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"> <rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<!-- TODO Enable this test. -->
<!-- We disable this: We want to allow small function on 1 line -->
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket"> <rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine"> <rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine" />
<severity>0</severity>
</rule> <!-- We disable this: Too many false positive -->
<rule ref="PEAR.Functions.FunctionCallSignature.Indent"> <rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
<severity>0</severity> <rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket" />
</rule> <rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket" />
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
<severity>0</severity>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue" /> <rule ref="PEAR.Functions.ValidDefaultValue" />
@ -361,26 +355,26 @@
<severity>0</severity> <severity>0</severity>
</rule> </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"> <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
<severity>0</severity> <severity>0</severity>
</rule> </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"> <rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName" /> <rule ref="PEAR.NamingConventions.ValidFunctionName" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore" />
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore"> <!-- We disable this: there is a lot of existing function not starting with a capital letter (class modXxxx, ...) -->
<severity>0</severity>
</rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid"> <rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital"> <rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital">
<severity>0</severity> <severity>0</severity>
</rule> </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"> <rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -391,16 +385,16 @@
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps"> <!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
<severity>0</severity> <severity>0</severity>
</rule>--> </rule>-->
<!-- We disable this: We don't want to have private methods prefixed with an underscore -->
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore"> <rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.NamingConventions.ValidVariableName" /> <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 --> <!-- 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"> <rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -411,7 +405,6 @@
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"> <rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line"> <rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
<severity>0</severity> <severity>0</severity>
</rule> </rule>
@ -421,15 +414,17 @@
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> --> <!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
<!-- Rules from Zend Standard--> <!-- Rules PSR 2 -->
<rule ref="PSR2.Classes.ClassDeclaration" />
<!-- The closing ?> tag MUST be omitted from files containing only PHP. --> <rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="Zend.Files.ClosingTag"/> <rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
<rule ref="PSR2.Classes.ClassDeclaration" /> <rule ref="PSR2.Classes.ClassDeclaration" />
<rule ref="PSR2.Methods.FunctionClosingBrace" /> <rule ref="PSR2.Methods.FunctionClosingBrace" />
<rule ref="PSR2.Files.EndFileNewline.TooMany" /> <rule ref="PSR2.Files.EndFileNewline.TooMany" />
<rule ref="PSR2.Files.EndFileNewline.NoneFound" /> <rule ref="PSR2.Files.EndFileNewline.NoneFound" />
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" /> <rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" /> <rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" />
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
<rule ref="PSR2.Files.ClosingTag"/>
</ruleset> </ruleset>

View File

@ -161,7 +161,7 @@ if (empty($reshook))
if ($action == 'disable') { if ($action == 'disable') {
if ($accounting->fetch($id)) { if ($accounting->fetch($id)) {
$mode = GETPOST('mode', 'int'); $mode = GETPOST('mode', 'int');
$result = $accounting->account_desactivate($id, $mode); $result = $accounting->accountDeactivate($id, $mode);
} }
$action = 'update'; $action = 'update';

View File

@ -55,7 +55,7 @@ $pagenext = $page + 1;
//if (! $sortfield) $sortfield="p.date_fin"; //if (! $sortfield) $sortfield="p.date_fin";
//if (! $sortorder) $sortorder="DESC"; //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_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')); $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 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 = ''; $show_subgroup = '';
$search_accountancy_code_end = '';
$search_date_start = ''; $search_date_start = '';
$search_date_end = ''; $search_date_end = '';
$search_accountancy_code_start = '';
$search_accountancy_code_end = '';
$filter = array(); $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 .= $form->selectDate($search_date_start ? $search_date_start : -1, 'date_start', 0, 0, 1, '', 1, 0);
$moreforfilter .= $langs->trans('DateEnd').': '; $moreforfilter .= $langs->trans('DateEnd').': ';
$moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0); $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>'; $moreforfilter .= '</div>';
if (!empty($moreforfilter)) { if (!empty($moreforfilter)) {
@ -289,13 +296,18 @@ if ($action != 'export_csv')
} }
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Permet d'afficher le compte comptable if (!empty($show_subgroup))
if (empty($displayed_account) || $root_account_description != $displayed_account)
{ {
// Affiche un Sous-Total par compte comptable // Show accounting account
if (empty($displayed_account) || $root_account_description != $displayed_account) {
// Show subtotal per accounting account
if ($displayed_account != "") { 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 '<tr class="liste_total">';
print "<td>&nbsp;</td>\n"; 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>'; print '</tr>';
} }
@ -308,7 +320,7 @@ if ($action != 'export_csv')
$sous_total_debit = 0; $sous_total_debit = 0;
$sous_total_credit = 0; $sous_total_credit = 0;
} }
}
// $object->get_compte_racine($line->numero_compte); // $object->get_compte_racine($line->numero_compte);
print '<td>'.length_accountg($line->numero_compte).'</td>'; print '<td>'.length_accountg($line->numero_compte).'</td>';
@ -326,12 +338,15 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit; $sous_total_credit += $line->credit;
} }
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 '<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 "<td></td>\n";
print '</tr>'; 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 '<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 '</tr>';
print "</table>"; print "</table>";

View File

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

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 $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 * @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(); $result = $this->checkUsage();
if ($mode == 0)
{
$fieldtouse = 'active'; $fieldtouse = 'active';
} if ($mode == 1)
elseif ($mode == 1)
{ {
$fieldtouse = 'reconcilable'; $fieldtouse = 'reconcilable';
} }
@ -582,7 +577,7 @@ class AccountingAccount extends CommonObject
$sql .= "SET ".$fieldtouse." = '0'"; $sql .= "SET ".$fieldtouse." = '0'";
$sql .= " WHERE rowid = ".$this->db->escape($id); $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); $result = $this->db->query($sql);
if ($result) { if ($result) {

View File

@ -644,6 +644,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'color' && empty($_POST['color'])) continue;
if ($value == 'formula' && empty($_POST['formula'])) 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 ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((!isset($_POST[$value]) || $_POST[$value] == '') 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 && (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking')) // Fields that are not mandatory

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>. /* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>.
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> * 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"); * 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. * 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('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1);
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
/** /**

View File

@ -248,11 +248,8 @@ class Dolistore
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
$html = ""; $html = "";
$parity = "pair";
$last_month = time() - (30 * 24 * 60 * 60); $last_month = time() - (30 * 24 * 60 * 60);
foreach ($this->products as $product) { foreach ($this->products as $product) {
$parity = ($parity == "impair") ? 'pair' : 'impair';
// check new product ? // check new product ?
$newapp = ''; $newapp = '';
if ($last_month < strtotime($product->date_add)) { if ($last_month < strtotime($product->date_add)) {
@ -267,7 +264,7 @@ class Dolistore
// add image or default ? // add image or default ?
if ($product->id_default_image != '') { 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; $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.'">'; $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>'; $images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else { } else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />'; $images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
@ -306,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> //.'<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 //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="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1] <td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
.'<br/><small>'.$version.'</small></h2> .'<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> <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> // do not load if display none
<td class="margeCote center">'.$price.' //$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
</td> $html .= '<td class="margeCote center">'.$price.'</td>';
<td class="margeCote">'.$download_link.'</td> $html .= '<td class="margeCote">'.$download_link.'</td>';
</tr>'; $html .= '</tr>';
} }
return $html; return $html;
} }

View File

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

View File

@ -680,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('/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('/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"'); if (preg_match('/deprecated/i', $version)) $versiontrans .= img_warning($langs->trans("Deprecated"), 'style="float: left"');
if ($objMod->isCoreOrExternalModule() == 'external' || preg_match('/development|experimental|deprecated/i', $version)) {
$versiontrans .= $objMod->getVersion(1); $versiontrans .= $objMod->getVersion(1);
}
// Define imginfo // Define imginfo
$imginfo = "info"; $imginfo = "info";

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> /* 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -70,9 +71,10 @@ if ($action == 'setmod')
if ($action == 'setparams') if ($action == 'setparams')
{ {
$freetext = GETPOST('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS', 'none'); // No alpha here, we want exact string $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); $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 (!$res > 0) $error++;
if ($error) if ($error)
@ -253,6 +255,14 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $co
print '</td><td class="right">'; print '</td><td class="right">';
print "</td></tr>\n"; 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 '</table>';
print '</div>'; print '</div>';

View File

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

View File

@ -138,7 +138,7 @@ print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("AntiVirusCommand").'<br>'; 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 // Check command in inside safe_mode
print '</td>'; print '</td>';
print '<td>'; print '<td>';
@ -161,7 +161,7 @@ print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>'; 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 '<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) : '').'">'; 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; if (empty($conf->global->MAIN_SESSION_TIMEOUT)) $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("SessionTimeOut").'</td><td class="right">'; 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>';
print '<td class="nowrap">'; 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")); 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>'; print '</tr>';
$sessiontimeout = ini_get("session.gc_maxlifetime");
if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = ""; if (empty($conf->global->MAIN_APPLICATION_TITLE)) $conf->global->MAIN_APPLICATION_TITLE = "";
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">'; print '<td>'.$langs->trans("MAIN_APPLICATION_TITLE").'</td><td class="right">';

View File

@ -458,7 +458,17 @@ if ($conf->use_javascript_ajax) {
} }
print "</td>\n"; print "</td>\n";
print "</tr>\n"; print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("AlwaysShowFullArbo").'</td>';
print '<td class="right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STOCK_ALWAYS_SHOW_FULL_ARBO');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STOCK_ALWAYS_SHOW_FULL_ARBO", $arrval, $conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO);
}
print "</td>\n";
print "</tr>\n";
print '</table>'; print '</table>';
/* /*

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> /* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net> * 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 * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -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 * View
*/ */
@ -428,8 +446,46 @@ foreach ($dirmodels as $reldir)
print '</table>'; 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(); 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 // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -135,7 +135,7 @@ elseif (in_array($compression, array('gz', 'bz')))
$file .= '.tar'; $file .= '.tar';
// We also exclude '/temp/' dir and 'documents/admin/documents' // 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); $result = $utils->executeCLI($cmd, $outputfile);

View File

@ -523,7 +523,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$keyforbreak = 'duration'; $keyforbreak = 'duration';
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
print '<tr><td>'.$langs->trans("TotalCost").'</td><td>'.price($object->total_cost).'</td></tr>'; print '<tr><td>'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td><td>'.price($object->total_cost).'</td></tr>';
print '<tr><td>'.$langs->trans("UnitCost").'</td><td>'.price($object->unit_cost).'</td></tr>'; print '<tr><td>'.$langs->trans("UnitCost").'</td><td>'.price($object->unit_cost).'</td></tr>';
// Other attributes // Other attributes

View File

@ -1013,11 +1013,20 @@ class BOM extends CommonObject
$this->unit_cost = 0; $this->unit_cost = 0;
$this->total_cost = 0; $this->total_cost = 0;
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
foreach ($this->lines as &$line) { foreach ($this->lines as &$line) {
$tmpproduct = new Product($this->db); $tmpproduct = new Product($this->db);
$tmpproduct->fetch($line->fk_product); $tmpproduct->fetch($line->fk_product);
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($line->unit_cost)) {
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0)
{
$line->unit_cost = $productFournisseur->fourn_unitprice;
}
}
$line->unit_cost = (!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp; // TODO : add option to work with cost_price or pmp
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
$this->total_cost += $line->total_cost; $this->total_cost += $line->total_cost;
} }

View File

@ -79,7 +79,7 @@ function bomPrepareHead($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT."/bom/bom_card.php?id=".$object->id; $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'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -135,7 +135,7 @@ $head = array();
$h = 1; $h = 1;
$head[$h][0] = $_SERVER["PHP_SELF"].($object->id ? 'id='.$object->id : ''); $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'; $head[$h][2] = 'card';
$h++; $h++;

View File

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

View File

@ -64,9 +64,7 @@ class Categorie extends CommonObject
/** /**
* @var array ID mapping from type string * @var array Table of mapping between type string and ID used for field 'type' in table llx_categories
*
* @note This array should be removed in future, once previous constants are moved to the string value. Deprecated
*/ */
protected $MAP_ID = array( protected $MAP_ID = array(
'product' => 0, 'product' => 0,
@ -79,7 +77,8 @@ class Categorie extends CommonObject
'user' => 7, 'user' => 7,
'bank_line' => 8, 'bank_line' => 8,
'warehouse' => 9, 'warehouse' => 9,
'actioncomm' => 10 'actioncomm' => 10,
'website_page' => 11
); );
/** /**
@ -1113,6 +1112,10 @@ class Categorie extends CommonObject
global $conf, $langs; global $conf, $langs;
if (!is_numeric($type)) $type = $this->MAP_ID[$type]; if (!is_numeric($type)) $type = $this->MAP_ID[$type];
if (is_null($type)) {
$this->error = 'BadValueForParameterType';
return -1;
}
if (is_string($markafterid)) if (is_string($markafterid))
{ {

View File

@ -54,6 +54,7 @@ $typetext = $type;
if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea'); if ($type == Categorie::TYPE_ACCOUNT) $title = $langs->trans('AccountsCategoriesArea');
elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea'); elseif ($type == Categorie::TYPE_WAREHOUSE) $title = $langs->trans('StocksCategoriesArea');
elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea'); elseif ($type == Categorie::TYPE_ACTIONCOMM) $title = $langs->trans('ActionCommCategoriesArea');
elseif ($type == Categorie::TYPE_WEBSITE_PAGE) $title = $langs->trans('WebsitePagesCategoriesArea');
else $title = $langs->trans(ucfirst($type).'sCategoriesArea'); else $title = $langs->trans(ucfirst($type).'sCategoriesArea');
$arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofjs = array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
@ -69,8 +70,6 @@ if (!empty($user->rights->categorie->creer)) {
print load_fiche_titre($title, $newcardbutton, 'object_category'); print load_fiche_titre($title, $newcardbutton, 'object_category');
//print '<table border="0" width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';
@ -88,20 +87,9 @@ print '<td colspan="3">'.$langs->trans("Search").'</td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven nohover"><td>'; print '<tr class="oddeven nohover"><td>';
print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>'; print $langs->trans("Name").':</td><td><input class="flat inputsearch" type="text" name="catname" value="'.$catname.'"/></td><td><input type="submit" class="button" value="'.$langs->trans("Search").'"></td></tr>';
/*
// faire une rech dans une sous categorie uniquement
print '<tr '.$bc[0].'><td>';
print $langs->trans("SubCatOf").':</td><td>';
print $form->select_all_categories('','subcatof');
print '</td>';
print '<td><input type="submit" class="button" value="'.$langs->trans ("Search").'"></td></tr>';
*/
print '</table></form>'; print '</table></form>';
//print '</td><td valign="top" width="70%">';
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
@ -138,7 +126,6 @@ if ($catname || $id > 0)
else print '&nbsp;'; else print '&nbsp;';
//print '</td></tr></table>';
print '</div></div></div>'; print '</div></div></div>';
print '<div class="fichecenter"><br>'; print '<div class="fichecenter"><br>';

View File

@ -735,7 +735,7 @@ if ($type == Categorie::TYPE_CONTACT)
$num = count($contacts); $num = count($contacts);
$nbtotalofrecords = ''; $nbtotalofrecords = '';
$newcardbutton = ''; $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 '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Ref").'</td></tr>'."\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>'; print '<br>';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = ''; $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 "<table class='noborder' width='100%'>\n";
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n"; print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Ref").'</td></tr>'."\n";

View File

@ -177,12 +177,6 @@ class ActionComm extends CommonObject
*/ */
public $fulldayevent = 0; public $fulldayevent = 0;
/**
* @var int Milestone
* @deprecated Milestone is already event with end date = start date
*/
public $punctual = 1;
/** /**
* @var integer Percentage * @var integer Percentage
*/ */
@ -343,6 +337,20 @@ class ActionComm extends CommonObject
*/ */
public $errors_to; public $errors_to;
/**
* Typical value for a event that is in a todo state
*/
const EVENT_TODO = 0;
/**
* Typical value for a event that is in a progress state
*/
const EVENT_IN_PROGRESS = 50;
/**
* Typical value for a event that is in a finished state
*/
const EVENT_FINISHED = 100;
/** /**
* Constructor * Constructor
@ -384,7 +392,6 @@ class ActionComm extends CommonObject
if (empty($this->percentage)) $this->percentage = 0; if (empty($this->percentage)) $this->percentage = 0;
if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0;
if (empty($this->fulldayevent)) $this->fulldayevent = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0;
if (empty($this->punctual)) $this->punctual = 0;
if (empty($this->transparency)) $this->transparency = 0; if (empty($this->transparency)) $this->transparency = 0;
if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage > 100) $this->percentage = 100;
//if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; //if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date;
@ -462,7 +469,7 @@ class ActionComm extends CommonObject
$sql .= "fk_user_author,"; $sql .= "fk_user_author,";
$sql .= "fk_user_action,"; $sql .= "fk_user_action,";
$sql .= "fk_user_done,"; $sql .= "fk_user_done,";
$sql .= "label,percent,priority,fulldayevent,location,punctual,"; $sql .= "label,percent,priority,fulldayevent,location,";
$sql .= "transparency,"; $sql .= "transparency,";
$sql .= "fk_element,"; $sql .= "fk_element,";
$sql .= "elementtype,"; $sql .= "elementtype,";
@ -492,7 +499,7 @@ class ActionComm extends CommonObject
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", "; $sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", "; $sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", "; $sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
$sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."','".$this->db->escape($this->punctual)."', "; $sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."', ";
$sql .= "'".$this->db->escape($this->transparency)."', "; $sql .= "'".$this->db->escape($this->transparency)."', ";
$sql .= (!empty($this->fk_element) ? $this->fk_element : "null").", "; $sql .= (!empty($this->fk_element) ? $this->fk_element : "null").", ";
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", "; $sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";
@ -679,6 +686,7 @@ class ActionComm extends CommonObject
$sql = "SELECT a.id,"; $sql = "SELECT a.id,";
$sql .= " a.id as ref,"; $sql .= " a.id as ref,";
$sql .= " a.entity,";
$sql .= " a.ref_ext,"; $sql .= " a.ref_ext,";
$sql .= " a.datep,"; $sql .= " a.datep,";
$sql .= " a.datep2,"; $sql .= " a.datep2,";
@ -692,7 +700,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_user_action, a.fk_user_done,"; $sql .= " a.fk_user_action, a.fk_user_done,";
$sql .= " a.fk_contact, a.percent as percentage,"; $sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element as elementid, a.elementtype,"; $sql .= " a.fk_element as elementid, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,";
$sql .= " s.nom as socname,"; $sql .= " s.nom as socname,";
$sql .= " u.firstname, u.lastname as lastname"; $sql .= " u.firstname, u.lastname as lastname";
@ -715,6 +723,7 @@ class ActionComm extends CommonObject
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->id; $this->id = $obj->id;
$this->entity = $obj->entity;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
@ -756,7 +765,6 @@ class ActionComm extends CommonObject
$this->fulldayevent = $obj->fulldayevent; $this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location; $this->location = $obj->location;
$this->transparency = $obj->transparency; $this->transparency = $obj->transparency;
$this->punctual = $obj->punctual; // deprecated
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working $this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
$this->contactid = $obj->fk_contact; // To have fetch_contact method working $this->contactid = $obj->fk_contact; // To have fetch_contact method working
@ -1610,7 +1618,7 @@ class ActionComm extends CommonObject
$sql .= " a.fk_user_action,"; $sql .= " a.fk_user_action,";
$sql .= " a.fk_contact, a.percent as percentage,"; $sql .= " a.fk_contact, a.percent as percentage,";
$sql .= " a.fk_element, a.elementtype,"; $sql .= " a.fk_element, a.elementtype,";
$sql .= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,"; $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,";
$sql .= " u.firstname, u.lastname, u.email,"; $sql .= " u.firstname, u.lastname, u.email,";
$sql .= " s.nom as socname,"; $sql .= " s.nom as socname,";
$sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label"; $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label";
@ -1717,7 +1725,6 @@ class ActionComm extends CommonObject
$event['fulldayevent'] = $obj->fulldayevent; $event['fulldayevent'] = $obj->fulldayevent;
$event['location'] = $obj->location; $event['location'] = $obj->location;
$event['transparency'] = (($obj->transparency > 0) ? 'OPAQUE' : 'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy) $event['transparency'] = (($obj->transparency > 0) ? 'OPAQUE' : 'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
$event['punctual'] = $obj->punctual;
$event['category'] = $obj->type_label; $event['category'] = $obj->type_label;
$event['email'] = $obj->email; $event['email'] = $obj->email;
// Define $urlwithroot // Define $urlwithroot
@ -1927,11 +1934,7 @@ class ActionComm extends CommonObject
$this->datem = $now; $this->datem = $now;
$this->datep = $now; $this->datep = $now;
$this->datef = $now; $this->datef = $now;
$this->author = $user;
$this->usermod = $user;
$this->usertodo = $user;
$this->fulldayevent = 0; $this->fulldayevent = 0;
$this->punctual = 0;
$this->percentage = 0; $this->percentage = 0;
$this->location = 'Location'; $this->location = 'Location';
$this->transparency = 1; // 1 means opaque $this->transparency = 1; // 1 means opaque
@ -2019,4 +2022,32 @@ class ActionComm extends CommonObject
return $error; return $error;
} }
/**
* Udpate the percent value of a event with the given id
*
* @param int $id The id of the event
* @param int $percent The new percent value for the event
* @return int 1 when update of the event was suscessfull, otherwise -1
*/
public function updatePercent($id, $percent)
{
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql .= " SET percent = ".(int) $percent;
$sql .= " WHERE id=".$id;
if ($this->db->query($sql))
{
$this->db->commit();
return 1;
}
else
{
$this->db->rollback();
$this->error = $this->db->lasterror();
return -1;
}
}
} }

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr> * Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other")); $langs->loadLangs(array("users", "companies", "agenda", "commercial", "other"));
$action = GETPOST('action', 'alpha'); $action = GETPOST('action', 'alpha');
$massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); $resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); $pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
@ -49,6 +51,8 @@ $optioncss = GETPOST('optioncss', 'alpha');
$year = GETPOST("year", 'int'); $year = GETPOST("year", 'int');
$month = GETPOST("month", 'int'); $month = GETPOST("month", 'int');
$day = GETPOST("day", 'int'); $day = GETPOST("day", 'int');
$toselect = GETPOST('toselect', 'array');
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('search_actioncode', 'array')) if (GETPOST('search_actioncode', 'array'))
{ {
@ -185,9 +189,42 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$datestart = ''; $datestart = '';
$dateend = ''; $dateend = '';
$search_status = ''; $search_status = '';
$toselect = '';
$search_array_options = array(); $search_array_options = array();
} }
if (empty($reshook) && !empty($massaction))
{
unset($percent);
switch ($massaction)
{
case 'set_all_events_to_todo':
$percent = ActionComm::EVENT_TODO;
break;
case 'set_all_events_to_in_progress':
$percent = ActionComm::EVENT_IN_PROGRESS;
break;
case 'set_all_events_to_finished':
$percent = ActionComm::EVENT_FINISHED;
break;
}
if(isset($percent))
{
foreach ($toselect as $toselectid)
{
$result = $object->updatePercent($toselectid, $percent);
if($result < 0)
{
dol_print_error($db);
break;
}
}
}
}
/* /*
* View * View
@ -239,6 +276,15 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
// Add $param from extra fields // Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// List of mass actions available
$arrayofmassactions = array(
'set_all_events_to_todo' => $langs->trans("SetAllEventsToTodo"),
'set_all_events_to_in_progress' => $langs->trans("SetAllEventsToInProgress"),
'set_all_events_to_finished' => $langs->trans("SetAllEventsToFinished"),
);
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$sql = "SELECT"; $sql = "SELECT";
if ($usergroup > 0) $sql .= " DISTINCT"; if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,"; $sql .= " s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
@ -366,6 +412,8 @@ if ($resql)
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$arrayofselected = is_array($toselect) ? $toselect : array();
// Local calendar // Local calendar
$newtitle = '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>'; $newtitle = '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
//$newtitle=$langs->trans($title); //$newtitle=$langs->trans($title);
@ -436,7 +484,7 @@ if ($resql)
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')));
} }
print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit, 0, 0, 1);
$moreforfilter = ''; $moreforfilter = '';
@ -740,7 +788,15 @@ if ($resql)
$datep = $db->jdate($obj->datep); $datep = $db->jdate($obj->datep);
print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).'</td>'; print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).'</td>';
} }
print '<td></td>'; // Action column
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
{
$selected = 0;
if (in_array($obj->id, $arrayofselected)) $selected = 1;
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
print "</tr>\n"; print "</tr>\n";
$i++; $i++;

View File

@ -5,7 +5,7 @@
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * 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) 2013 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * 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 .= '<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">'; $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 // Box proposals
$tmp = $object->getOutstandingProposals(); $tmp = $object->getOutstandingProposals();
@ -600,7 +600,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>'; if ($link) $boxstat .= '</a>';
} }
if (!empty($conf->commande->enabled)) if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
// Box commandes // Box commandes
$tmp = $object->getOutstandingOrders(); $tmp = $object->getOutstandingOrders();
@ -618,7 +618,7 @@ if ($object->id > 0)
if ($link) $boxstat .= '</a>'; if ($link) $boxstat .= '</a>';
} }
if (!empty($conf->facture->enabled)) if (!empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
// Box factures // Box factures
$tmp = $object->getOutstandingBills(); $tmp = $object->getOutstandingBills();

View File

@ -157,6 +157,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
$limit = 10; $limit = 10;
$sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat"; $sql = "SELECT m.rowid, m.titre, m.nbemail, m.statut, m.date_creat";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql .= " WHERE m.entity = ".$conf->entity;
$sql .= " ORDER BY m.date_creat DESC"; $sql .= " ORDER BY m.date_creat DESC";
$sql .= " LIMIT ".$limit; $sql .= " LIMIT ".$limit;
$result = $db->query($sql); $result = $db->query($sql);

View File

@ -499,7 +499,7 @@ if ($resql)
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'propal', 0, $newcardbutton, '', $limit, 0, 0, 1);
$topicmail = "SendPropalRef"; $topicmail = "SendPropalRef";
$modelmail = "proposal_send"; $modelmail = "propal_send";
$objecttmp = new Propal($db); $objecttmp = new Propal($db);
$trackid = 'pro'.$object->id; $trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';

View File

@ -2018,7 +2018,7 @@ class Commande extends CommonOrder
/** /**
* Load array lines * Load array lines
* *
* @param int $only_product Return only physical products * @param int $only_product Return only physical products, not services
* @param int $loadalsotranslation Return translation for products * @param int $loadalsotranslation Return translation for products
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr> * Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -37,8 +38,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php';
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips")); // Constant to define payment sens
const PAY_DEBIT = 0;
const PAY_CREDIT = 1;
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries", "compta", "trips", "banks", "loan"));
$date_start = GETPOST('date_start', 'alpha'); $date_start = GETPOST('date_start', 'alpha');
$date_startDay = GETPOST('date_startday', 'int'); $date_startDay = GETPOST('date_startday', 'int');
@ -140,7 +149,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Customer invoices // Customer invoices
if (GETPOST('selectinvoices')) { if (GETPOST('selectinvoices')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; $sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total as total_ht, t.total_ttc, t.tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail; $sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -149,7 +158,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Vendor invoices // Vendor invoices
if (GETPOST('selectsupplierinvoices')) { if (GETPOST('selectsupplierinvoices')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum"; $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql .= " WHERE datef between ".$wheretail; $sql .= " WHERE datef between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -158,7 +167,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Expense reports // Expense reports
if (GETPOST('selectexpensereports')) { if (GETPOST('selectexpensereports')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; $sql .= " SELECT t.rowid as id, t.entity, t.ref, t.paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.fk_user_author as fk_soc, t.date_fin as date, t.date_fin as date_due, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE date_fin between ".$wheretail; $sql .= " WHERE date_fin between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -167,7 +176,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Donations // Donations
if (GETPOST('selectdonations')) { if (GETPOST('selectdonations')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; $sql .= " SELECT t.rowid as id, t.entity, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, t.datedon as date, t.datedon as date_due, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_CREDIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country"; $sql .= " FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country";
$sql .= " WHERE datedon between ".$wheretail; $sql .= " WHERE datedon between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -176,7 +185,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Paiements of salaries // Paiements of salaries
if (GETPOST('selectpaymentsofsalaries')) { if (GETPOST('selectpaymentsofsalaries')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.ref as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum"; $sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, t.datep as date, t.dateep as date_due, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country"; $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql .= " WHERE datep between ".$wheretail; $sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
@ -185,12 +194,28 @@ if (($action == 'searchfiles' || $action == 'dl')) {
// Social contributions // Social contributions
if (GETPOST('selectsocialcontributions')) { if (GETPOST('selectsocialcontributions')) {
if (!empty($sql)) $sql .= " UNION ALL"; if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_creation as date, t.date_ech as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum"; $sql .= " SELECT t.rowid as id, t.entity, t.libelle as ref, t.paye as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.date_ech as date, t.periode as date_due, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as t";
$sql .= " WHERE date_creation between ".$wheretail; $sql .= " WHERE t.date_ech between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')'; $sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT; //$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
} }
// Various payments
if (GETPOST('selectvariouspayment')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, t.entity, t.label as ref, 1 as paid, t.amount as total_ht, t.amount as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'VariousPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_various as t";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND t.entity IN (".($entity == 1 ? '0,1' : $entity).')';
}
// Loan payments
if (GETPOST('selectloanspayment')) {
if (!empty($sql)) $sql .= " UNION ALL";
$sql .= " SELECT t.rowid as id, l.entity, l.label as ref, 1 as paid, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ht, (t.amount_capital+t.amount_insurance+t.amount_interest) as total_ttc, 0 as total_tva, 0 as fk_soc, t.datep as date, t.datep as date_due, 'LoanPayment' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum, ".PAY_DEBIT." as sens";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as t LEFT JOIN ".MAIN_DB_PREFIX."loan as l ON l.rowid = t.fk_loan";
$sql .= " WHERE datep between ".$wheretail;
$sql .= " AND l.entity IN (".($entity == 1 ? '0,1' : $entity).')';
}
if ($sql) { if ($sql) {
$sql .= $db->order($sortfield, $sortorder); $sql .= $db->order($sortfield, $sortorder);
@ -221,6 +246,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->facture->dir_output.'/'.$subdir; $upload_dir = $conf->facture->dir_output.'/'.$subdir;
$link = "document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "facture";
break; break;
case "SupplierInvoice": case "SupplierInvoice":
$tmpinvoicesupplier->fetch($objd->id); $tmpinvoicesupplier->fetch($objd->id);
@ -228,18 +254,21 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir; $upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$link = "document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "facture_fournisseur";
break; break;
case "ExpenseReport": case "ExpenseReport":
$subdir = ''; $subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->expensereport->dir_output.'/'.$subdir; $upload_dir = $conf->expensereport->dir_output.'/'.$subdir;
$link = "document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "expensereport";
break; break;
case "SalaryPayment": case "SalaryPayment":
$subdir = ''; $subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->salaries->dir_output.'/'.$subdir; $upload_dir = $conf->salaries->dir_output.'/'.$subdir;
$link = "document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "salaries";
break; break;
case "Donation": case "Donation":
$tmpdonation->fetch($objp->id); $tmpdonation->fetch($objp->id);
@ -247,12 +276,28 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->don->dir_output.'/'.$subdir; $upload_dir = $conf->don->dir_output.'/'.$subdir;
$link = "document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "don";
break; break;
case "SocialContributions": case "SocialContributions":
$subdir = ''; $subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id); $subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->tax->dir_output.'/'.$subdir; $upload_dir = $conf->tax->dir_output.'/'.$subdir;
$link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F'; $link = "document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "tax";
break;
case "VariousPayment":
$subdir = '';
$subdir .= ($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->bank->dir_output.'/'.$subdir;
$link = "document.php?modulepart=banque&file=".str_replace('/', '%2F', $subdir).'%2F';
$modulepart = "banque";
break;
case "LoanPayment":
// Loan payment has no linked file
$subdir = '';
$upload_dir = $conf->loan->dir_output.'/'.$subdir;
$link = "";
$modulepart = "";
break; break;
default: default:
$subdir = ''; $subdir = '';
@ -286,6 +331,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$nofile['thirdparty_code'] = $objd->thirdparty_code; $nofile['thirdparty_code'] = $objd->thirdparty_code;
$nofile['country_code'] = $objd->country_code; $nofile['country_code'] = $objd->country_code;
$nofile['vatnum'] = $objd->vatnum; $nofile['vatnum'] = $objd->vatnum;
$nofile['sens'] = $objd->sens;
$filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile;
} }
@ -304,11 +350,11 @@ if (($action == 'searchfiles' || $action == 'dl')) {
$file['ref'] = ($objd->ref ? $objd->ref : $objd->id); $file['ref'] = ($objd->ref ? $objd->ref : $objd->id);
$file['fk'] = $objd->fk_soc; $file['fk'] = $objd->fk_soc;
$file['item'] = $objd->item; $file['item'] = $objd->item;
$file['thirdparty_name'] = $objd->thirdparty_name; $file['thirdparty_name'] = $objd->thirdparty_name;
$file['thirdparty_code'] = $objd->thirdparty_code; $file['thirdparty_code'] = $objd->thirdparty_code;
$file['country_code'] = $objd->country_code; $file['country_code'] = $objd->country_code;
$file['vatnum'] = $objd->vatnum; $file['vatnum'] = $objd->vatnum;
$file['sens'] = $objd->sens;
// Save record into array (only the first time it is found) // Save record into array (only the first time it is found)
if (empty($filesarray[$file['item'].'_'.$file['id']])) { if (empty($filesarray[$file['item'].'_'.$file['id']])) {
@ -319,7 +365,16 @@ if (($action == 'searchfiles' || $action == 'dl')) {
if (empty($filesarray[$file['item'].'_'.$file['id']]['files'])) { if (empty($filesarray[$file['item'].'_'.$file['id']]['files'])) {
$filesarray[$file['item'].'_'.$file['id']]['files'] = array(); $filesarray[$file['item'].'_'.$file['id']]['files'] = array();
} }
$filesarray[$file['item'].'_'.$file['id']]['files'][] = array('link' => $link.$file['name'], 'name'=>$file['name'], 'ref'=>$file['ref'], 'fullname' => $file['fullname'], 'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name']); $filesarray[$file['item'].'_'.$file['id']]['files'][] = array(
'link' => $link.urlencode($file['name']),
'name'=>$file['name'],
'ref'=>$file['ref'],
'fullname' => $file['fullname'],
'relpath' => '/'.$file['name'],
'relpathnamelang' => $langs->trans($file['item']).'/'.$file['name'],
'modulepart' => $modulepart,
'subdir' => $subdir,
);
//var_dump($file['item'].'_'.$file['id']); //var_dump($file['item'].'_'.$file['id']);
//var_dump($filesarray[$file['item'].'_'.$file['id']]['files']); //var_dump($filesarray[$file['item'].'_'.$file['id']]['files']);
} }
@ -383,7 +438,8 @@ if ($result && $action == "dl" && !$error)
$log .= ','.$langs->transnoentitiesnoconv("ThirdParty"); $log .= ','.$langs->transnoentitiesnoconv("ThirdParty");
$log .= ','.$langs->transnoentitiesnoconv("Code"); $log .= ','.$langs->transnoentitiesnoconv("Code");
$log .= ','.$langs->transnoentitiesnoconv("Country"); $log .= ','.$langs->transnoentitiesnoconv("Country");
$log .= ','.$langs->transnoentitiesnoconv("VATIntra")."\n"; $log .= ','.$langs->transnoentitiesnoconv("VATIntra");
$log .= ','.$langs->transnoentitiesnoconv("Sens")."\n";
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip'; $zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
dol_delete_file($zipname); dol_delete_file($zipname);
@ -394,11 +450,13 @@ if ($result && $action == "dl" && !$error)
{ {
foreach ($filesarray as $key => $file) foreach ($filesarray as $key => $file)
{ {
if (!empty($file['files'])) {
foreach ($file['files'] as $filecursor) { foreach ($file['files'] as $filecursor) {
if (file_exists($filecursor["fullname"])) { if (file_exists($filecursor["fullname"])) {
$zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]); $zip->addFile($filecursor["fullname"], $filecursor["relpathnamelang"]);
} }
} }
}
$log .= '"'.$langs->trans($file['item']).'"'; $log .= '"'.$langs->trans($file['item']).'"';
if (!empty($conf->multicompany->enabled) && is_object($mc)) if (!empty($conf->multicompany->enabled) && is_object($mc))
@ -418,6 +476,7 @@ if ($result && $action == "dl" && !$error)
$log .= ',"'.$file['thirdparty_code'].'"'; $log .= ',"'.$file['thirdparty_code'].'"';
$log .= ',"'.$file['country_code'].'"'; $log .= ',"'.$file['country_code'].'"';
$log .= ',"'.$file['vatnum'].'"'; $log .= ',"'.$file['vatnum'].'"';
$log .= ',"'.$file['sens'].'"';
$log .= "\n"; $log .= "\n";
} }
$zip->addFromString('transactions.csv', $log); $zip->addFromString('transactions.csv', $log);
@ -444,10 +503,17 @@ if ($result && $action == "dl" && !$error)
* View * View
*/ */
$form = new Form($db); $form = new form($db);
$formfile = new FormFile($db);
$userstatic = new User($db); $userstatic = new User($db);
$invoice = new Facture($db); $invoice = new Facture($db);
$supplier_invoice = new FactureFournisseur($db); $supplier_invoice = new FactureFournisseur($db);
$expensereport = new ExpenseReport($db);
$don = new Don($db);
$salary_payment = new PaymentSalary($db);
$charge_sociales = new ChargeSociales($db);
$various_payment = new PaymentVarious($db);
$payment_loan = new PaymentLoan($db);
$title = $langs->trans("ComptaFiles").' - '.$langs->trans("List"); $title = $langs->trans("ComptaFiles").' - '.$langs->trans("List");
$help_url = ''; $help_url = '';
@ -492,7 +558,9 @@ $listofchoices = array(
'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'lang'=>'trips'),
'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'), 'selectdonations'=>array('label'=>'Donations', 'lang'=>'donation'),
'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'lang'=>'salaries'),
'selectsocialcontributions'=>array('label'=>'SocialContributions') 'selectsocialcontributions'=>array('label'=>'SocialContributions'),
'selectvariouspayment'=>array('label'=>'VariousPayment'),
'selectloanspayment'=>array('label'=>'PaymentLoan'),
); );
foreach ($listofchoices as $choice => $val) { foreach ($listofchoices as $choice => $val) {
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : ''); $checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
@ -562,11 +630,12 @@ if (!empty($date_start) && !empty($date_stop))
{ {
// Sort array by date ASC to calculate balance // Sort array by date ASC to calculate balance
$totalET = 0; $totalET_debit = 0;
$totalIT = 0; $totalIT_debit = 0;
$totalVAT = 0; $totalVAT_debit = 0;
$totalDebit = 0; $totalET_credit = 0;
$totalCredit = 0; $totalIT_credit = 0;
$totalVAT_credit = 0;
// Display array // Display array
foreach ($TData as $data) foreach ($TData as $data)
@ -600,6 +669,30 @@ if (!empty($date_start) && !empty($date_stop))
$supplier_invoice->id = $data['id']; $supplier_invoice->id = $data['id'];
$supplier_invoice->ref = $data['ref']; $supplier_invoice->ref = $data['ref'];
print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0); print $supplier_invoice->getNomUrl(1, '', 0, 0, '', 0, 0, 0);
} elseif ($data['item'] == 'ExpenseReport') {
$expensereport->id = $data['id'];
$expensereport->ref = $data['ref'];
print $expensereport->getNomUrl(1, 0, 0, '', 0, 0);
} elseif ($data['item'] == 'SalaryPayment') {
$salary_payment->id = $data['id'];
$salary_payment->ref = $data['ref'];
print $salary_payment->getNomUrl(1, '', 0, '', 0);
} elseif ($data['item'] == 'Donation') {
$don->id = $data['id'];
$don->ref = $data['ref'];
print $don->getNomUrl(1, 0, '', 0);
} elseif ($data['item'] == 'SocialContributions') {
$charge_sociales->id = $data['id'];
$charge_sociales->ref = $data['ref'];
print $charge_sociales->getNomUrl(1, 0, 0, 0, 0);
} elseif ($data['item'] == 'VariousPayment') {
$various_payment->id = $data['id'];
$various_payment->ref = $data['ref'];
print $various_payment->getNomUrl(1, '', 0, 0);
} elseif ($data['item'] == 'LoanPayment') {
$payment_loan->id = $data['id'];
$payment_loan->ref = $data['ref'];
print $payment_loan->getNomUrl(1, 0, 0, '', 0);
} else { } else {
print $data['ref']; print $data['ref'];
} }
@ -609,8 +702,8 @@ if (!empty($date_start) && !empty($date_stop))
print '<td>'; print '<td>';
if (!empty($data['files'])) if (!empty($data['files']))
{ {
foreach ($data['files'] as $filecursor) { foreach ($data['files'] as $id=>$filecursor) {
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a><br>'; print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a>&nbsp;'.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
} }
} }
print "</td>\n"; print "</td>\n";
@ -619,11 +712,11 @@ if (!empty($date_start) && !empty($date_stop))
print '<td aling="left">'.$data['paid'].'</td>'; print '<td aling="left">'.$data['paid'].'</td>';
// Total ET // Total ET
print '<td align="right">'.price($data['amount_ht'])."</td>\n"; print '<td align="right">'.price($data['sens'] ? $data['amount_ht'] : -$data['amount_ht'])."</td>\n";
// Total IT // Total IT
print '<td align="right">'.price($data['amount_ttc'])."</td>\n"; print '<td align="right">'.price($data['sens'] ? $data['amount_ttc'] : -$data['amount_ttc'])."</td>\n";
// Total VAT // Total VAT
print '<td align="right">'.price($data['amount_vat'])."</td>\n"; print '<td align="right">'.price($data['sens'] ? $data['amount_vat'] : -$data['amount_vat'])."</td>\n";
print '<td>'.$data['thirdparty_name']."</td>\n"; print '<td>'.$data['thirdparty_name']."</td>\n";
@ -633,42 +726,42 @@ if (!empty($date_start) && !empty($date_stop))
print '<td align="right">'.$data['vatnum']."</td>\n"; print '<td align="right">'.$data['vatnum']."</td>\n";
// Debit if ($data['sens']) {
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? price(abs($data['amount_ttc'])) : '')."</td>\n"; $totalET_credit += $data['amount_ht'];
// Credit $totalIT_credit += $data['amount_ttc'];
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? '' : price(abs($data['amount_ttc'])))."</td>\n"; $totalVAT_credit += $data['amount_vat'];
} else {
$totalET += $data['amount_ht']; $totalET_debit -= $data['amount_ht'];
$totalIT += $data['amount_ttc']; $totalIT_debit -= $data['amount_ttc'];
$totalVAT += $data['amount_vat']; $totalVAT_debit -= $data['amount_vat'];
}
$totalDebit += ($data['amount_ttc'] > 0) ? abs($data['amount_ttc']) : 0;
$totalCredit += ($data['amount_ttc'] > 0) ? 0 : abs($data['amount_ttc']);
// Balance
//print '<td align="right">'.price($data['balance'])."</td>\n";
print "</tr>\n"; print "</tr>\n";
} }
// Total credits
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td></td>'; print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Income').'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalET_credit, 'MT')).'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalIT_credit, 'MT')).'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalVAT_credit, 'MT')).'</td>';
print '<td></td>'; print '<td colspan="4"></td>';
print '<td></td>'; print "</tr>\n";
print '<td align="right">'.price(price2num($totalET, 'MT')).'</td>'; // Total debits
print '<td align="right">'.price(price2num($totalIT, 'MT')).'</td>'; print '<tr class="liste_total">';
print '<td align="right">'.price(price2num($totalVAT, 'MT')).'</td>'; print '<td colspan="6" class="right">'.$langs->trans('Total').' '.$langs->trans('Outcome').'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalET_debit, 'MT')).'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalIT_debit, 'MT')).'</td>';
print '<td></td>'; print '<td align="right">'.price(price2num($totalVAT_debit, 'MT')).'</td>';
print '<td></td>'; print '<td colspan="4"></td>';
/*print '<td align="right">'.price($totalDebit).'</td>'; print "</tr>\n";
print '<td align="right">'.price($totalCredit).'</td>'; // Balance
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>'; print '<tr class="liste_total">';
*/ print '<td colspan="6" class="right">'.$langs->trans('Total').'</td>';
print '<td align="right">'.price(price2num($totalET_credit + $totalET_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalIT_credit + $totalIT_debit, 'MT')).'</td>';
print '<td align="right">'.price(price2num($totalVAT_credit + $totalVAT_debit, 'MT')).'</td>';
print '<td colspan="4"></td>';
print "</tr>\n"; print "</tr>\n";
} }
} }

View File

@ -131,15 +131,14 @@ if ($result)
print '<input type="hidden" name="categid" value="'.$objp->rowid.'">'; print '<input type="hidden" name="categid" value="'.$objp->rowid.'">';
print '<input name="label" type="text" size=45 value="'.$objp->label.'">'; print '<input name="label" type="text" size=45 value="'.$objp->label.'">';
print '<input type="submit" name="update" class="button" value="'.$langs->trans("Edit").'">'; print '<input type="submit" name="update" class="button" value="'.$langs->trans("Edit").'">';
print "</td>"; print "</td>";
} }
else else
{ {
print "<td >".$objp->label."</td>"; print "<td >".$objp->label."</td>";
print '<td style="text-align: center;">'; print '<td class="center">';
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=edit">'.img_edit().'</a>&nbsp;&nbsp;'; print '<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=edit">'.img_edit().'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=delete">'.img_delete().'</a>'; print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?categid='.$objp->rowid.'&amp;action=delete">'.img_delete().'</a>';
print '</td>'; print '</td>';
} }
print "</tr>"; print "</tr>";

View File

@ -1672,8 +1672,7 @@ class Account extends CommonObject
//Replace the old AccountNumber key with the new BankAccountNumber key //Replace the old AccountNumber key with the new BankAccountNumber key
$fieldlists = explode( $fieldlists = explode(
' ', ' ',
preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', preg_replace('/ ?[^Bank]AccountNumber ?/', 'BankAccountNumber', $conf->global->BANK_SHOW_ORDER_OPTION)
$conf->global->BANK_SHOW_ORDER_OPTION)
); );
} }
} }

View File

@ -46,7 +46,7 @@ $object->info($id);
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("BankTransaction");
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id;

View File

@ -257,7 +257,7 @@ foreach ($cats as $cat) {
$tabs = array( $tabs = array(
array( array(
DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid, DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$rowid,
$langs->trans('Card') $langs->trans('BankTransaction')
), ),
array( array(
DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid, DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$rowid,

View File

@ -612,7 +612,7 @@ if (empty($action) || $action == "view" || $action == "close")
else { else {
$head = array(); $head = array();
$head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id; $head[0][0] = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.$object->id;
$head[0][1] = $langs->trans("Card"); $head[0][1] = $langs->trans("CashControl");
$head[0][2] = 'cashcontrol'; $head[0][2] = 'cashcontrol';
dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account'); dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account');

View File

@ -1025,7 +1025,7 @@ if (empty($reshook))
// Replacement invoice // Replacement invoice
if ($_POST['type'] == Facture::TYPE_REPLACEMENT) if ($_POST['type'] == Facture::TYPE_REPLACEMENT)
{ {
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($dateinvoice)) if (empty($dateinvoice))
{ {
$error++; $error++;
@ -1086,7 +1086,7 @@ if (empty($reshook))
$action = 'create'; $action = 'create';
} }
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($dateinvoice)) if (empty($dateinvoice))
{ {
$error++; $error++;
@ -1269,7 +1269,7 @@ if (empty($reshook))
// Standard invoice or Deposit invoice, created from a Predefined template invoice // Standard invoice or Deposit invoice, created from a Predefined template invoice
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0) if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && GETPOST('fac_rec', 'int') > 0)
{ {
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($dateinvoice)) if (empty($dateinvoice))
{ {
$error++; $error++;
@ -1320,7 +1320,7 @@ if (empty($reshook))
$action = 'create'; $action = 'create';
} }
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $dateinvoice = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($dateinvoice)) if (empty($dateinvoice))
{ {
$error++; $error++;
@ -1745,7 +1745,7 @@ if (empty($reshook))
// Situation invoices // Situation invoices
if (GETPOST('type') == Facture::TYPE_SITUATION && (!empty($_POST['situations']))) if (GETPOST('type') == Facture::TYPE_SITUATION && (!empty($_POST['situations'])))
{ {
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); $datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
if (empty($datefacture)) { if (empty($datefacture)) {
$error++; $error++;
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")); $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date"));
@ -2907,6 +2907,18 @@ if ($action == 'create')
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code; if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
} }
// when payment condition is empty (means not override by payment condition form a other object, like third-party), try to use default value
if(empty($cond_reglement_id))
{
$cond_reglement_id = GETPOST("cond_reglement_id");
}
// when payment mode is empty (means not override by payment mode form a other object, like third-party), try to use default value
if(empty($mode_reglement_id))
{
$mode_reglement_id = GETPOST("mode_reglement_id");
}
if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts(); if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
$note_public = $object->getDefaultCreateValueFor('note_public', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_public : null)); $note_public = $object->getDefaultCreateValueFor('note_public', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_public : null));
$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_private : null)); $note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc) && !empty($conf->global->FACTURE_REUSE_NOTES_ON_CREATE_FROM)) ? $objectsrc->note_private : null));
@ -5282,7 +5294,7 @@ elseif ($id > 0 || !empty($ref))
{ {
if (!$objectidnext) if (!$objectidnext)
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').''.$object->id.'&amp;action=create&amp;type=2'.($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?socid='.$object->socid.'&amp;fac_avoir='.$object->id.'&amp;action=create&amp;type=2'.($object->fk_project > 0 ? '&amp;projectid='.$object->fk_project : '').''.($object->entity > 0 ? '&amp;originentity='.$object->entity : '').'">'.$langs->trans("CreateCreditNote").'</a>';
} }
} }

View File

@ -342,7 +342,7 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Bill').'</td>'; print '<td>'.$langs->trans('Bill').'</td>';
print '<td>'.$langs->trans('Company').'</td>'; print '<td>'.$langs->trans('Company').'</td>';
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)print '<td>'.$langs->trans('Entity').'</td>'; if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) print '<td>'.$langs->trans('Entity').'</td>';
print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>'; print '<td class="right">'.$langs->trans('ExpectedToPay').'</td>';
print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>'; print '<td class="right">'.$langs->trans('PayedByThisPayment').'</td>';
print '<td class="right">'.$langs->trans('RemainderToPay').'</td>'; print '<td class="right">'.$langs->trans('RemainderToPay').'</td>';
@ -379,7 +379,7 @@ if ($resql)
print '</td>'; print '</td>';
// Expected to pay // Expected to pay
if ($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED) { if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_INVOICE_SHARING_ENABLED)) {
print '<td>'; print '<td>';
$mc->getInfo($objp->entity); $mc->getInfo($objp->entity);
print $mc->label; print $mc->label;

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,6 +27,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/rapport/pdf_paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Security check // Security check
@ -84,6 +86,7 @@ if ($action == 'builddoc')
*/ */
$formother = new FormOther($db); $formother = new FormOther($db);
$formfile = new FormFile($db);
llxHeader(); llxHeader();
@ -155,7 +158,7 @@ if ($year)
$tfile = $dir.'/'.$year.'/'.$file; $tfile = $dir.'/'.$year.'/'.$file;
$relativepath = $year.'/'.$file; $relativepath = $year.'/'.$file;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a></td>'; print '<td><a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart=facture_paiement&amp;file='.urlencode($relativepath).'">'.img_pdf().' '.$file.'</a>'.$formfile->showPreview($file, 'facture_paiement', $relativepath, 0).'</td>';
print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>'; print '<td class="right">'.dol_print_size(dol_filesize($tfile)).'</td>';
print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td>'; print '<td class="right">'.dol_print_date(dol_filemtime($tfile), "dayhour").'</td>';
print '</tr>'; print '</tr>';

View File

@ -128,7 +128,7 @@ $form = new Form($db);
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("PaymentSocialContribution");
$hselected = $h; $hselected = $h;
$h++; $h++;

View File

@ -0,0 +1,234 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/paymentbybanktransfer/index.php
* \ingroup paymentbybanktransfer
* \brief Payment by bank transfer index page
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'withdrawals'));
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'paymentbybanktransfer', '', '');
/*
* Actions
*/
/*
* View
*/
llxHeader('', $langs->trans("SuppliersStandingOrdersArea"));
if (prelevement_check_config() < 0)
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
}
print load_fiche_titre($langs->trans("SuppliersStandingOrdersArea"));
print '<div class="fichecenter"><div class="fichethirdleft">';
$thirdpartystatic = new Societe($db);
$invoicestatic = new Facture($db);
$bprev = new BonPrelevement($db);
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("NbOfInvoiceToWithdraw").'</td>';
print '<td class="right">';
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/demandes.php?status=0">';
print $bprev->NbFactureAPrelever();
print '</a>';
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("AmountToWithdraw").'</td>';
print '<td class="right">';
print price($bprev->SommeAPrelever(), '', '', 1, -1, -1, 'auto');
print '</td></tr></table></div><br>';
/*
* Invoices waiting for withdraw
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
$sql .= " s.nom as name, s.rowid as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " , ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
$sql .= " WHERE s.rowid = f.fk_soc";
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= " AND f.total_ttc > 0";
if (empty($conf->global->WITHDRAWAL_ALLOW_ANY_INVOICE_STATUS))
{
$sql .= " AND f.fk_statut = ".Facture::STATUS_VALIDATED;
}
$sql .= " AND pfd.traite = 0 AND pfd.fk_facture_fourn = f.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<th colspan="5">'.$langs->trans("SupplierInvoiceWaitingWithdraw").' ('.$num.')</th></tr>';
if ($num)
{
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
$invoicestatic->id = $obj->rowid;
$invoicestatic->ref = $obj->ref;
$invoicestatic->statut = $obj->fk_statut;
$invoicestatic->paye = $obj->paye;
$invoicestatic->type = $obj->type;
$alreadypayed = $invoicestatic->getSommePaiement();
print '<tr class="oddeven"><td>';
print $invoicestatic->getNomUrl(1, 'withdraw');
print '</td>';
print '<td>';
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
print $thirdpartystatic->getNomUrl(1, 'customer');
print '</td>';
print '<td class="right">';
print price($obj->amount);
print '</td>';
print '<td class="right">';
print dol_print_date($db->jdate($obj->date_demande), 'day');
print '</td>';
print '<td class="right">';
print $invoicestatic->getLibStatut(3, $alreadypayed);
print '</td>';
print '</tr>';
$i++;
}
}
else
{
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).'</td></tr>';
}
print "</table></div><br>";
}
else
{
dol_print_error($db);
}
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
/*
* Withdraw receipts
*/
$limit = 5;
$sql = "SELECT p.rowid, p.ref, p.amount, p.datec, p.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
$sql .= " ORDER BY datec DESC";
$sql .= $db->plimit($limit);
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
print"\n<!-- debut table -->\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><th>'.$langs->trans("LatestBankTransferReceipts", $limit).'</th>';
print '<th>'.$langs->trans("Date").'</th>';
print '<th class="right">'.$langs->trans("Amount").'</th>';
print '<th class="right">'.$langs->trans("Status").'</th>';
print '</tr>';
while ($i < min($num, $limit))
{
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print "<td>";
$bprev->id = $obj->rowid;
$bprev->ref = $obj->ref;
$bprev->statut = $obj->statut;
print $bprev->getNomUrl(1);
print "</td>\n";
print '<td>'.dol_print_date($db->jdate($obj->datec), "dayhour")."</td>\n";
print '<td class="right">'.price($obj->amount)."</td>\n";
print '<td class="right">'.$bprev->getLibStatut(3)."</td>\n";
print "</tr>\n";
$i++;
}
print "</table></div><br>";
$db->free($result);
}
else
{
dol_print_error($db);
}
print '</div></div></div>';
// End of page
llxFooter();
$db->close();

View File

@ -65,6 +65,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist')); $hookmanager->initHooks(array('directdebitprevcard', 'globalcard', 'directdebitprevlist'));
/* /*
* Actions * Actions
*/ */
@ -271,10 +272,6 @@ if ($id > 0 || $ref)
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode", $object->methodes_trans); print $form->selectarray("methode", $object->methodes_trans);
print '</td></tr>'; print '</td></tr>';
/*print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat" type="file" name="userfile"><br>';
print '</td></tr>';*/
print '</table><br>'; print '</table><br>';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
print '</form>'; print '</form>';

View File

@ -126,7 +126,7 @@ llxHeader('', $langs->trans("StandingOrder"));
$h = 0; $h = 0;
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("StandingOrder");
$hselected = $h; $hselected = $h;
$h++; $h++;

View File

@ -1454,7 +1454,7 @@ else
print '<tr><td>'; print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">'; print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$object->id.'">'; print '<a href="'.DOL_URL_ROOT.'/contact/vcard.php?id='.$object->id.'">';
print img_picto($langs->trans("Download"), 'vcard.png').' '; print img_picto($langs->trans("Download"), 'vcard.png', 'class="paddingrightonly"');
print $langs->trans("Download"); print $langs->trans("Download");
print '</a>'; print '</a>';
print '</td></tr>'; print '</td></tr>';

View File

@ -1590,7 +1590,7 @@ class Contact extends CommonObject
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{ {
$tables = array( $tables = array(
'socpeople' 'socpeople', 'societe_contacts'
); );
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);

View File

@ -358,7 +358,6 @@ if (strlen($search_fax)) $sql .= natural_search('p.fax', $search_fax)
if (!empty($conf->socialnetworks->enabled)) { if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) { foreach ($socialnetworks as $key => $value) {
if ($value['active'] && strlen($search_{$key})) { if ($value['active'] && strlen($search_{$key})) {
//$sql.= natural_search("p.socialnetworks->'$.".$key."'", $search_{$key});
$sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_{$key}.'%\''; $sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_{$key}.'%\'';
} }
} }

View File

@ -1452,7 +1452,7 @@ else
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield" width="100%">';
// Ligne info remises tiers // Line info of thirdparty discounts
print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">'; print '<tr><td class="titlefield">'.$langs->trans('Discount').'</td><td colspan="3">';
if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $object->thirdparty->remise_percent); if ($object->thirdparty->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $object->thirdparty->remise_percent);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
@ -1502,8 +1502,6 @@ else
} }
$colorb = '666666';
$arrayothercontracts = $object->getListOfContracts('others'); $arrayothercontracts = $object->getListOfContracts('others');
/* /*
@ -1775,8 +1773,8 @@ else
print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht, 0, '', 0).'"></td>'; print '<input id="buying_price" type="text" size="5" name="buying_price" value="'.price($objp->pa_ht, 0, '', 0).'"></td>';
} }
print '<td class="center">'; print '<td class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button margintoponly marginbottomonly" name="save" value="'.$langs->trans("Modify").'">';
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; print '<br><input type="submit" class="button margintoponly marginbottomonly" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -43,9 +43,9 @@ if (!empty($user->socid)) {
$socid = $user->socid; $socid = $user->socid;
} }
if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { /*if (empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set'); accessforbidden('Calling this file is allowed only when MAIN_DIRECT_STATUS_UPDATE is set');
} }*/
/* /*
@ -75,5 +75,10 @@ if (($action == 'set') && !empty($id)) {
$triggerkey = 'COMPANY_UPDATE'; $triggerkey = 'COMPANY_UPDATE';
} }
$object->setValueFrom($field, $value, $element, $id, $user, $triggerkey); $tablename = $element;
if ($tablename == 'websitepage') $tablename = 'website_page';
$format = 'int';
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
} }

View File

@ -43,7 +43,7 @@ $number = strlen($letters);
$string = ''; $string = '';
for ($i = 0; $i < $length; $i++) for ($i = 0; $i < $length; $i++)
{ {
$string .= $letters{mt_rand(0, $number - 1)}; $string .= $letters[mt_rand(0, $number - 1)];
} }
//print $string; //print $string;

View File

@ -140,7 +140,10 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedManualEntries")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedManualEntries")
);
$this->db->free($result); $this->db->free($result);
} else { } else {

View File

@ -153,7 +153,10 @@ class box_boms extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result); $this->db->free($result);
} else { } else {

View File

@ -148,7 +148,10 @@ class box_clients extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result); $this->db->free($result);
} }

View File

@ -174,7 +174,10 @@ class box_commandes extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result); $this->db->free($result);
} else { } else {

View File

@ -180,7 +180,10 @@ class box_factures_imp extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoUnpaidCustomerBills")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoUnpaidCustomerBills")
);
$this->db->free($result); $this->db->free($result);
} }

View File

@ -145,13 +145,16 @@ class box_ficheinter extends ModeleBoxes
$i++; $i++;
} }
if ($num == 0) $this->info_box_contents[$i][] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedInterventions")); if ($num == 0) $this->info_box_contents[$i][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedInterventions")
);
$this->db->free($resql); $this->db->free($resql);
} }
else else
{ {
$this->info_box_contents[0][] = array( $this->info_box_contents[0][0] = array(
'td' => '', 'td' => '',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($this->db->error().' sql='.$sql), 'text' => ($this->db->error().' sql='.$sql),
@ -160,7 +163,7 @@ class box_ficheinter extends ModeleBoxes
} }
else else
{ {
$this->info_box_contents[0][] = array( $this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"', 'td' => 'class="nohover opacitymedium left"',
'text' => $langs->trans("ReadPermissionNotAllowed") 'text' => $langs->trans("ReadPermissionNotAllowed")
); );

View File

@ -136,7 +136,7 @@ class box_fournisseurs extends ModeleBoxes
} }
if ($num == 0) $this->info_box_contents[$line][0] = array( if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center"', 'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedSuppliers"), 'text'=>$langs->trans("NoRecordedSuppliers"),
); );

View File

@ -142,7 +142,10 @@ class box_goodcustomers extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedCustomers")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedCustomers")
);
$this->db->free($result); $this->db->free($result);
} }

View File

@ -149,7 +149,10 @@ class box_mos extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedOrders")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedOrders")
);
$this->db->free($result); $this->db->free($result);
} else { } else {

View File

@ -149,7 +149,7 @@ class box_prospect extends ModeleBoxes
if ($num == 0) { if ($num == 0) {
$this->info_box_contents[$line][0] = array( $this->info_box_contents[$line][0] = array(
'td' => 'class="center"', 'td' => 'class="center opacitymedium"',
'text'=> $langs->trans("NoRecordedProspects"), 'text'=> $langs->trans("NoRecordedProspects"),
); );
} }

View File

@ -223,7 +223,10 @@ class box_services_contracts extends ModeleBoxes
$i++; $i++;
} }
if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoContractedProducts")); if ($num == 0) $this->info_box_contents[$i][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoContractedProducts")
);
$this->db->free($result); $this->db->free($result);
} }

View File

@ -158,7 +158,10 @@ class box_shipments extends ModeleBoxes
$line++; $line++;
} }
if ($num == 0) $this->info_box_contents[$line][0] = array('td' => 'class="center"', 'text'=>$langs->trans("NoRecordedShipments")); if ($num == 0) $this->info_box_contents[$line][0] = array(
'td' => 'class="center opacitymedium"',
'text'=>$langs->trans("NoRecordedShipments")
);
$this->db->free($result); $this->db->free($result);
} else { } else {

View File

@ -8070,7 +8070,10 @@ abstract class CommonObject
{ {
if (empty($id) && empty($ref) && empty($morewhere)) return -1; if (empty($id) && empty($ref) && empty($morewhere)) return -1;
$sql = 'SELECT '.$this->getFieldList(); $fieldlist = $this->getFieldList();
if (empty($fieldlist)) return 0;
$sql = 'SELECT '.$fieldlist;
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element;
if (!empty($id)) $sql .= ' WHERE rowid = '.$id; if (!empty($id)) $sql .= ' WHERE rowid = '.$id;

View File

@ -1,4 +1,6 @@
<?php <?php
use Splash\Tests\WsObjects\O00ObjectBaseTest;
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com> * Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
@ -37,7 +39,7 @@ class Conf
public $file; public $file;
/** /**
* @var DoliDB Database handler. * @var Object Associative array with some properties ->type, ->db, ...
*/ */
public $db; public $db;

View File

@ -43,7 +43,7 @@ class ExtraFields
public $db; public $db;
/** /**
* @var string type of element (for what object is the extrafield) * @var array Array with type of element (for what object is the extrafield)
* @deprecated * @deprecated
*/ */
public $attribute_elementtype; public $attribute_elementtype;

File diff suppressed because it is too large Load Diff

View File

@ -368,6 +368,8 @@ class Form
$s = picto_from_langcode($langcode, 'class="pictoforlang paddingright"'); $s = picto_from_langcode($langcode, 'class="pictoforlang paddingright"');
$resultforextrlang .= $s; $resultforextrlang .= $s;
// TODO Use the showInputField() method of ExtraLanguages object
if ($typeofdata == 'textarea') { if ($typeofdata == 'textarea') {
$resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">'; $resultforextrlang .= '<textarea name="field-'.$object->element."-".$fieldname."-".$langcode.'" id="'.$fieldname."-".$langcode.'" class="'.$morecss.'" rows="'.ROWS_2.'" wrap="soft">';
$resultforextrlang .= $valuetoshow; $resultforextrlang .= $valuetoshow;
@ -665,16 +667,18 @@ class Form
* @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default. * @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
* @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action. * @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $alwaysvisible 1=select button always visible * @param int $alwaysvisible 1=select button always visible
* @param string $name Name for massaction
* @param string $cssclass CSS class used to check for select
* @return string|void Select list * @return string|void Select list
*/ */
public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0) public function selectMassAction($selected, $arrayofaction, $alwaysvisible = 0, $name = 'massaction', $cssclass = 'checkforselect')
{ {
global $conf, $langs, $hookmanager; global $conf, $langs, $hookmanager;
$disabled = 0; $disabled = 0;
$ret = '<div class="centpercent center">'; $ret = '<div class="centpercent center">';
$ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' massaction massactionselect valignmiddle" name="massaction"'.($disabled ? ' disabled="disabled"' : '').'>'; $ret .= '<select class="flat'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' ' . $name . ' ' . $name . 'select valignmiddle" name="' . $name . '"'.($disabled ? ' disabled="disabled"' : '').'>';
// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks. // Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
$parameters = array(); $parameters = array();
@ -693,46 +697,46 @@ class Form
$ret .= '</select>'; $ret .= '</select>';
if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.massactionselect'); if (empty($conf->dol_optimize_smallscreen)) $ret .= ajax_combobox('.' . $name . 'select');
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER. $ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
$ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' massaction massactionconfirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; $ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' ' . $name . ' ' . $name . 'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '</div>'; $ret .= '</div>';
if (!empty($conf->use_javascript_ajax)) if (!empty($conf->use_javascript_ajax))
{ {
$ret .= '<!-- JS CODE TO ENABLE mass action select --> $ret .= '<!-- JS CODE TO ENABLE mass action select -->
<script> <script>
function initCheckForSelect(mode) /* mode is 0 during init of page or click all, 1 when we click on 1 checkbox */ function initCheckForSelect(mode, name, cssclass) /* mode is 0 during init of page or click all, 1 when we click on 1 checkboxi, "name" refers to the class of the massaction button, "cssclass" to the class of the checkfor select boxes */
{ {
atleastoneselected=0; atleastoneselected=0;
jQuery(".checkforselect").each(function( index ) { jQuery("."+cssclass).each(function( index ) {
/* console.log( index + ": " + $( this ).text() ); */ /* console.log( index + ": " + $( this ).text() ); */
if ($(this).is(\':checked\')) atleastoneselected++; if ($(this).is(\':checked\')) atleastoneselected++;
}); });
console.log("initCheckForSelect mode="+mode+" atleastoneselected="+atleastoneselected); console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected);
if (atleastoneselected || '.$alwaysvisible.') if (atleastoneselected || '.$alwaysvisible.')
{ {
jQuery(".massaction").show(); jQuery("."+name).show();
'.($selected ? 'if (atleastoneselected) { jQuery(".massactionselect").val("'.$selected.'").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', false); }' : '').' '.($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("'.$selected.'").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '').'
'.($selected ? 'if (! atleastoneselected) { jQuery(".massactionselect").val("0").trigger(\'change\'); jQuery(".massactionconfirmed").prop(\'disabled\', true); } ' : '').' '.($selected ? 'if (! atleastoneselected) { jQuery("."+name+"select").val("0").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', true); } ' : '').'
} }
else else
{ {
jQuery(".massaction").hide(); jQuery("."+name).hide();
jQuery(".massactionother").hide(); jQuery("."+name+"other").hide();
} }
} }
jQuery(document).ready(function () { jQuery(document).ready(function () {
initCheckForSelect(0); initCheckForSelect(0, "' . $name . '", "' . $cssclass . '");
jQuery(".checkforselect").click(function() { jQuery(".' . $cssclass . '").click(function() {
initCheckForSelect(1); initCheckForSelect(1, "'.$name.'", "' . $cssclass . '");
}); });
jQuery(".massactionselect").change(function() { jQuery(".' . $name . 'select").change(function() {
var massaction = $( this ).val(); var massaction = $( this ).val();
var urlform = $( this ).closest("form").attr("action").replace("#show_files",""); var urlform = $( this ).closest("form").attr("action").replace("#show_files","");
if (massaction == "builddoc") if (massaction == "builddoc")
@ -744,13 +748,13 @@ class Form
/* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */ /* Warning: if you set submit button to disabled, post using Enter will no more work if there is no other button */
if ($(this).val() != \'0\') if ($(this).val() != \'0\')
{ {
jQuery(".massactionconfirmed").prop(\'disabled\', false); jQuery(".' . $name . 'confirmed").prop(\'disabled\', false);
jQuery(".massactionother").show(); jQuery(".' . $name . 'other").show();
} }
else else
{ {
jQuery(".massactionconfirmed").prop(\'disabled\', true); jQuery(".' . $name . 'confirmed").prop(\'disabled\', true);
jQuery(".massactionother").hide(); jQuery(".' . $name . 'other").hide();
} }
}); });
}); });
@ -2842,7 +2846,7 @@ class Form
} }
if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode"; if (!empty($conf->barcode->enabled)) $sql .= ", pfp.barcode";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )";
if ($socid) $sql .= " AND pfp.fk_soc = ".$socid; if ($socid) $sql .= " AND pfp.fk_soc = ".$socid;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
// Units // Units
@ -7791,18 +7795,19 @@ class Form
* *
* @param string $cssclass CSS class * @param string $cssclass CSS class
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
* @param string $massactionname Mass action button name that will launch an action on the selected items
* @return string * @return string
*/ */
public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0) public function showCheckAddButtons($cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction")
{ {
global $conf, $langs; global $conf, $langs;
$out = ''; $out = '';
$id = uniqid(); $id = uniqid();
if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="checkallactions'.$id.'" name="checkallactions" class="checkallactions"></div>'; if (!empty($conf->use_javascript_ajax)) $out .= '<div class="inline-block checkallactions"><input type="checkbox" id="' . $cssclass . 's" name="' . $cssclass . 's" class="checkallactions"></div>';
$out .= '<script> $out .= '<script>
$(document).ready(function() { $(document).ready(function() {
$("#checkallactions'.$id.'").click(function() { $("#' . $cssclass . 's").click(function() {
if($(this).is(\':checked\')){ if($(this).is(\':checked\')){
console.log("We check all '.$cssclass.'"); console.log("We check all '.$cssclass.'");
$(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\');
@ -7812,10 +7817,10 @@ class Form
console.log("We uncheck all"); console.log("We uncheck all");
$(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\'); $(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\');
}'."\n"; }'."\n";
if ($calljsfunction) $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; if ($calljsfunction) $out .= 'if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0, "' . $massactionname . '", "' . $cssclass . '"); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }';
$out .= ' }); $out .= ' });
$(".checkforselect").change(function() { $(".' . $cssclass . '").change(function() {
$(this).closest("tr").toggleClass("highlight", this.checked); $(this).closest("tr").toggleClass("highlight", this.checked);
}); });
@ -7831,14 +7836,15 @@ class Form
* @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this * @param int $addcheckuncheckall Add the check all/uncheck all checkbox (use javascript) and code to manage this
* @param string $cssclass CSS class * @param string $cssclass CSS class
* @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes * @param int $calljsfunction 0=default. 1=call function initCheckForSelect() after changing status of checkboxes
* @param string $massactionname Mass action name
* @return string * @return string
*/ */
public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0) public function showFilterAndCheckAddButtons($addcheckuncheckall = 0, $cssclass = 'checkforaction', $calljsfunction = 0, $massactionname = "massaction")
{ {
$out = $this->showFilterButtons(); $out = $this->showFilterButtons();
if ($addcheckuncheckall) if ($addcheckuncheckall)
{ {
$out .= $this->showCheckAddButtons($cssclass, $calljsfunction); $out .= $this->showCheckAddButtons($cssclass, $calljsfunction, $massactionname);
} }
return $out; return $out;
} }

View File

@ -620,11 +620,12 @@ class FormProjets
* @param int $showallnone Add choice "All" and "None" * @param int $showallnone Add choice "All" and "None"
* @param int $showpercent Show default probability for status * @param int $showpercent Show default probability for status
* @param string $morecss Add more css * @param string $morecss Add more css
* @param int $noadmininfo 0=Add admin info, 1=Disable admin info
* @return int|string The HTML select list of element or '' if nothing or -1 if KO * @return int|string The HTML select list of element or '' if nothing or -1 if KO
*/ */
public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '') public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0)
{ {
global $conf, $langs; global $conf, $langs, $user;
$sql = "SELECT rowid, code, label, percent"; $sql = "SELECT rowid, code, label, percent";
$sql .= " FROM ".MAIN_DB_PREFIX.'c_lead_status'; $sql .= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
@ -670,6 +671,7 @@ class FormProjets
$i++; $i++;
} }
$sellist .= '</select>'; $sellist .= '</select>';
if ($user->admin && !$noadmininfo) $sellist .= info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
} }
/*else /*else
{ {

View File

@ -328,8 +328,13 @@ class Interfaces
continue; continue;
} }
$text = '';
try {
$objMod = new $modName($db); $objMod = new $modName($db);
if (is_subclass_of($objMod, 'DolibarrTriggers'))
{
// Define disabledbyname and disabledbymodule // Define disabledbyname and disabledbymodule
$disabledbyname = 0; $disabledbyname = 0;
$disabledbymodule = 1; $disabledbymodule = 1;
@ -371,6 +376,14 @@ class Interfaces
if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'<br>'; if ($disabledbymodule == 1) $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'<br>';
if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>'; if ($disabledbymodule == 2) $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>';
} }
}
else {
print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers<br>';
}
}
catch (Exception $e) {
print $e->getMessage();
}
$triggers[$j]['info'] = $text; $triggers[$j]['info'] = $text;
$j++; $j++;

View File

@ -1966,7 +1966,7 @@ class Lessc {
$this->pushEnv(); $this->pushEnv();
$parser = new lessc_parser($this, __METHOD__); $parser = new lessc_parser($this, __METHOD__);
foreach ($args as $name => $strValue) { foreach ($args as $name => $strValue) {
if ($name{0} !== '@') { if ($name[0] !== '@') {
$name = '@'.$name; $name = '@'.$name;
} }
$parser->count = 0; $parser->count = 0;
@ -2638,7 +2638,7 @@ class lessc_parser {
$hidden = true; $hidden = true;
if (!isset($block->args)) { if (!isset($block->args)) {
foreach ($block->tags as $tag) { foreach ($block->tags as $tag) {
if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) {
$hidden = false; $hidden = false;
break; break;
} }
@ -2692,7 +2692,7 @@ class lessc_parser {
protected function fixTags($tags) { protected function fixTags($tags) {
// move @ tags out of variable namespace // move @ tags out of variable namespace
foreach ($tags as &$tag) { foreach ($tags as &$tag) {
if ($tag{0} == $this->lessc->vPrefix) if ($tag[0] == $this->lessc->vPrefix)
$tag[0] = $this->lessc->mPrefix; $tag[0] = $this->lessc->mPrefix;
} }
return $tags; return $tags;

View File

@ -308,7 +308,7 @@ class Translate
continue; continue;
} }
else { else {
// Convert some strings: Parse and render carriage returns. Also, change '\\s' int '\s' because transifex sync pull the string '\s' into string '\\s' // Convert some strings: Parse and render carriage returns. Also, change '\\s' into '\s' because transifex sync pull the string '\s' into string '\\s'
$this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value); $this->tab_translate[$key] = str_replace(array('\\n', '\\\\s'), array("\n", '\s'), $value);
if ($usecachekey) { if ($usecachekey) {
$tabtranslatedomain[$key] = $value; $tabtranslatedomain[$key] = $value;

View File

@ -56,7 +56,7 @@ function accounting_prepare_head(AccountingAccount $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Asset");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -20,7 +20,7 @@
/** /**
* \file htdocs/core/lib/ajax.lib.php * \file htdocs/core/lib/ajax.lib.php
* \brief Page called by Ajax request for produts * \brief Page called to enhance interface with Javascript and Ajax features.
*/ */

View File

@ -39,7 +39,7 @@ function bank_prepare_head(Account $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("BankAccount");
$head[$h][2] = 'bankname'; $head[$h][2] = 'bankname';
$h++; $h++;
@ -211,7 +211,7 @@ function various_payment_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("VariousPayment");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -40,7 +40,7 @@ function categories_prepare_head(Categorie $object, $type)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&amp;type='.$type; $head[$h][0] = DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&amp;type='.$type;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Category");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -46,7 +46,7 @@ function societe_prepare_head(Societe $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("ThirdParty");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -367,7 +367,7 @@ function societe_prepare_head2($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/societe/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("ThirdParty");
$head[$h][2] = 'company'; $head[$h][2] = 'company';
$h++; $h++;

View File

@ -38,7 +38,7 @@ function contact_prepare_head(Contact $object)
$head = array(); $head = array();
$head[$tab][0] = DOL_URL_ROOT.'/contact/card.php?id='.$object->id; $head[$tab][0] = DOL_URL_ROOT.'/contact/card.php?id='.$object->id;
$head[$tab][1] = $langs->trans("Card"); $head[$tab][1] = $langs->trans("Contact");
$head[$tab][2] = 'card'; $head[$tab][2] = 'card';
$tab++; $tab++;

View File

@ -912,7 +912,7 @@ function num_open_day($timestampStart, $timestampEnd, $inhour = 0, $lastday = 0,
$nbOpenDay = $lastday; $nbOpenDay = $lastday;
if ($inhour == 1) $nbOpenDay = $nbOpenDay*24 . $langs->trans("HourShort"); if ($inhour == 1) $nbOpenDay = ($nbOpenDay * 24);
return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday)); return $nbOpenDay - (($inhour == 1 ? 12 : 0.5) * abs($halfday));
} }
else else

View File

@ -68,7 +68,7 @@ function donation_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/don/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Donation");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -81,14 +81,14 @@ function ecm_prepare_head($object, $module = 'ecm', $section = '')
if ($module == 'ecm') if ($module == 'ecm')
{ {
$head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Directory");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
} }
else else
{ {
$head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module; $head[$h][0] = DOL_URL_ROOT.'/ecm/dir_card.php?section='.$section.'&module='.$module;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Directory");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
} }
@ -109,7 +109,7 @@ function ecm_file_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label); $head[$h][0] = DOL_URL_ROOT.'/ecm/file_card.php?section='.$object->section_id.'&urlfile='.urlencode($object->label);
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("File");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -35,7 +35,7 @@ function expensereport_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/expensereport/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/expensereport/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("ExpenseReport");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -94,7 +94,7 @@ function payment_expensereport_prepare_head(PaymentExpenseReport $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("ExpenseReport");
$head[$h][2] = 'payment'; $head[$h][2] = 'payment';
$h++; $h++;

View File

@ -42,7 +42,7 @@ function fichinter_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fichinter/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Intervention");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -35,7 +35,7 @@ function fiscalyear_prepare_head(Fiscalyear $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("FiscalPeriod");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -3149,7 +3149,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array( if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building', 'accountancy', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'bookmark', 'bom', 'building',
'cash-register', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes', 'cash-register', 'category', 'check', 'close_title', 'company', 'contact', 'contract', 'cubes',
'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help',
'intervention', 'label', 'language', 'list', 'listlight', 'lot', 'intervention', 'label', 'language', 'list', 'listlight', 'lot',
@ -3162,15 +3162,15 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment',
'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal',
'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', 'object_other', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask',
'object_shipment', 'object_supplier_invoice', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_shipment', 'object_supplier_invoice', 'object_supplier_invoicea', 'object_supplier_invoiced', 'object_supplier_order', 'object_supplier_proposal', 'object_service', 'object_stock',
'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member',
'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website', 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'object_website',
'off', 'on', 'order', 'off', 'on', 'order',
'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip', 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'projecttask', 'stock', 'resize', 'service', 'stats', 'trip',
'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top',
'home', 'companies', 'products', 'commercial', 'invoicing', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic', 'home', 'companies', 'products', 'commercial', 'invoicing', 'pencil-ruler', 'preview', 'project', 'projectpub', 'supplier_invoice', 'hrm', 'members', 'ticket', 'generic',
'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'error', 'warning', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda' 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda'
) )
@ -3178,7 +3178,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = $pictowithouttext; $fakey = $pictowithouttext;
$facolor = ''; $fasize = ''; $facolor = ''; $fasize = '';
$fa = 'fas'; $fa = 'fas';
if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark'))) { if (in_array($pictowithouttext, array('object_generic', 'note', 'off', 'on', 'object_bookmark', 'bookmark', 'vcard'))) {
$fa = 'far'; $fa = 'far';
} }
if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) { if (in_array($pictowithouttext, array('skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp'))) {
@ -3189,7 +3189,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$arrayconvpictotofa = array( $arrayconvpictotofa = array(
'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book', 'account'=>'university', 'accountancy'=>'money-check-alt', 'action'=>'calendar-alt', 'address'=> 'address-book',
'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billd'=>'file-medical', 'bom'=>'cubes', 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', 'bom'=>'cubes',
'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd',
'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins',
'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly',
@ -3212,7 +3212,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt', 'title_agenda'=>'calendar-alt',
'uparrow'=>'mail-forward', 'uparrow'=>'mail-forward', 'vcard'=>'address-card',
'jabber'=>'comment-o', 'jabber'=>'comment-o',
'website'=>'globe-americas' 'website'=>'globe-americas'
); );
@ -3263,7 +3263,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Add CSS // Add CSS
$arrayconvpictotomorcess = array( $arrayconvpictotomorcess = array(
'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'accountancy'=>'bg-infobox-bank_account', 'action'=>'bg-infobox-action', 'account'=>'bg-infobox-bank_account', 'accountancy'=>'bg-infobox-bank_account',
'bank_account'=>'bg-infobox-bank_account', 'bill'=>'bg-infobox-commande', 'billa'=>'bg-infobox-commande', 'billd'=>'bg-infobox-commande', 'bank_account'=>'bg-infobox-bank_account',
'bill'=>'bg-infobox-commande', 'billa'=>'bg-infobox-commande', 'billd'=>'bg-infobox-commande',
'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'conversation'=>'bg-infobox-contrat', 'cash-register'=>'bg-infobox-bank_account', 'contract'=>'bg-infobox-contrat', 'check'=>'font-status4', 'conversation'=>'bg-infobox-contrat',
'donation'=>'bg-infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action', 'donation'=>'bg-infobox-commande', 'dollyrevert'=>'flip', 'ecm'=>'bg-infobox-action',
'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat', 'hrm'=>'bg-infobox-adherent', 'group'=>'bg-infobox-adherent', 'intervention'=>'bg-infobox-contrat',
@ -3275,7 +3276,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande', 'holiday'=>'bg-infobox-holiday', 'invoice'=>'bg-infobox-commande',
'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal', 'payment'=>'bg-infobox-bank_account', 'poll'=>'bg-infobox-adherent', 'project'=>'bg-infobox-project', 'projecttask'=>'bg-infobox-project', 'propal'=>'bg-infobox-propal',
'resource'=>'bg-infobox-action', 'resource'=>'bg-infobox-action',
'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal', 'supplier_invoice'=>'bg-infobox-order_supplier', 'supplier_invoicea'=>'bg-infobox-order_supplier', 'supplier_invoiced'=>'bg-infobox-order_supplier',
'supplier_order'=>'bg-infobox-order_supplier', 'supplier_proposal'=>'bg-infobox-supplier_proposal',
'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action', 'ticket'=>'bg-infobox-contrat', 'title_accountancy'=>'bg-infobox-bank_account', 'title_hrm'=>'bg-infobox-holiday', 'trip'=>'bg-infobox-expensereport', 'title_agenda'=>'bg-infobox-action',
//'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action', //'title_setup'=>'bg-infobox-action', 'tools'=>'bg-infobox-action',
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode' 'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
@ -5794,7 +5796,8 @@ function dolGetFirstLineOfText($text, $nboflines = 1, $charset = 'UTF-8')
/** /**
* Replace CRLF in string with a HTML BR tag * Replace CRLF in string with a HTML BR tag.
* WARNING: The content after operation contains some HTML tags (the <br>) so be sure to also have encode the special chars of stringtoencode into HTML before.
* *
* @param string $stringtoencode String to encode * @param string $stringtoencode String to encode
* @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br * @param int $nl2brmode 0=Adding br before \n, 1=Replacing \n by br
@ -6048,7 +6051,7 @@ function dol_textishtml($msg, $option = 0)
* *
* @param string $text1 Text 1 * @param string $text1 Text 1
* @param string $text2 Text 2 * @param string $text2 Text 2
* @param bool $forxml false=Use <br>instead of \n if html content detected, true=Use <br /> instead of \n if html content detected * @param bool $forxml true=Use <br /> instead of <br> if we have to add a br tag
* @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter) * @param bool $invert invert order of description lines (we often use config MAIN_CHANGE_ORDER_CONCAT_DESCRIPTION in this parameter)
* @return string Text 1 + new line + Text2 * @return string Text 1 + new line + Text2
* @see dol_textishtml() * @see dol_textishtml()
@ -6063,9 +6066,9 @@ function dol_concatdesc($text1, $text2, $forxml = false, $invert = false)
} }
$ret = ''; $ret = '';
$ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ?dol_nl2br($text1, 0, $forxml) : $text1; $ret .= (!dol_textishtml($text1) && dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text1, 0, 1, '', 1), 0, $forxml) : $text1;
$ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "<br \>\n" : "<br>\n") : "\n") : ""; $ret .= (!empty($text1) && !empty($text2)) ? ((dol_textishtml($text1) || dol_textishtml($text2)) ? ($forxml ? "<br \>\n" : "<br>\n") : "\n") : "";
$ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ?dol_nl2br($text2, 0, $forxml) : $text2; $ret .= (dol_textishtml($text1) && !dol_textishtml($text2)) ? dol_nl2br(dol_escape_htmltag($text2, 0, 1, '', 1), 0, $forxml) : $text2;
return $ret; return $ret;
} }

View File

@ -35,7 +35,7 @@ function holiday_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/holiday/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Holiday");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -37,7 +37,7 @@ function establishment_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Establishment");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -38,7 +38,7 @@ function member_prepare_head(Adherent $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/card.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Member");
$head[$h][2] = 'general'; $head[$h][2] = 'general';
$h++; $h++;
@ -124,7 +124,7 @@ function member_type_prepare_head(AdherentType $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/type.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("MemberType");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -276,7 +276,7 @@ function subscription_prepare_head(Subscription $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Subscription");
$head[$h][2] = 'general'; $head[$h][2] = 'general';
$h++; $h++;

View File

@ -34,7 +34,7 @@ function payment_prepare_head(Paiement $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Payment");
$head[$h][2] = 'payment'; $head[$h][2] = 'payment';
$h++; $h++;
@ -69,7 +69,7 @@ function payment_supplier_prepare_head(Paiement $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Payment");
$head[$h][2] = 'payment'; $head[$h][2] = 'payment';
$h++; $h++;

View File

@ -40,7 +40,7 @@ function prelevement_prepare_head(BonPrelevement $object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("WithdrawalsReceipts");
$head[$h][2] = 'prelevement'; $head[$h][2] = 'prelevement';
$h++; $h++;

View File

@ -41,7 +41,7 @@ function product_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/product/card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("ProductOrService");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;
@ -216,7 +216,7 @@ function productlot_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_card.php?id=".$object->id; $head[$h][0] = DOL_URL_ROOT."/product/stock/productlot_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Lot");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -168,7 +168,7 @@ function task_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : ''); $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/task.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Project");
$head[$h][2] = 'task_task'; $head[$h][2] = 'task_task';
$h++; $h++;
@ -2226,10 +2226,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
print $projectstatic->getNomUrl(1); print $projectstatic->getNomUrl(1, '', 0, '', '-', 0, -1, 'nowraponall');
if (!in_array('projectlabel', $hiddenfields)) print '<br><span class="opacitymedium">'.dol_trunc($objp->title, 24).'</span>'; if (!in_array('projectlabel', $hiddenfields)) print '<br><span class="opacitymedium">'.dol_trunc($objp->title, 24).'</span>';
print '</td>'; print '</td>';
print '<td>'; print '<td class="nowraponall tdoverflowmax100">';
if ($objp->fk_soc > 0) if ($objp->fk_soc > 0)
{ {
$thirdpartystatic->id = $objp->fk_soc; $thirdpartystatic->id = $objp->fk_soc;

View File

@ -34,7 +34,7 @@ function salaries_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/salaries/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/salaries/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("SalaryPayment");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -192,6 +192,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if ($features == 'mo') $features = 'mrp'; if ($features == 'mo') $features = 'mrp';
if ($features == 'member') $features = 'adherent'; if ($features == 'member') $features = 'adherent';
if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; }; if ($features == 'subscription') { $features = 'adherent'; $feature2 = 'cotisation'; };
if ($features == 'websitepage') $features = 'website';
// Get more permissions checks from hooks // Get more permissions checks from hooks
$parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select); $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select);

View File

@ -463,15 +463,15 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len
{ {
$max = strlen($lowercase) - 1; $max = strlen($lowercase) - 1;
for ($x = 0; $x < $nbofchar; $x++) { for ($x = 0; $x < $nbofchar; $x++) {
$randomCode .= $lowercase{random_int(0, $max)}; $randomCode .= $lowercase[random_int(0, $max)];
} }
$max = strlen($uppercase) - 1; $max = strlen($uppercase) - 1;
for ($x = 0; $x < $nbofchar; $x++) { for ($x = 0; $x < $nbofchar; $x++) {
$randomCode .= $uppercase{random_int(0, $max)}; $randomCode .= $uppercase[random_int(0, $max)];
} }
$max = strlen($numbers) - 1; $max = strlen($numbers) - 1;
for ($x = 0; $x < $nbofcharlast; $x++) { for ($x = 0; $x < $nbofcharlast; $x++) {
$randomCode .= $numbers{random_int(0, $max)}; $randomCode .= $numbers[random_int(0, $max)];
} }
$generated_password = str_shuffle($randomCode); $generated_password = str_shuffle($randomCode);
@ -480,15 +480,15 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len
{ {
$max = strlen($lowercase) - 1; $max = strlen($lowercase) - 1;
for ($x = 0; $x < $nbofchar; $x++) { for ($x = 0; $x < $nbofchar; $x++) {
$randomCode .= $lowercase{mt_rand(0, $max)}; $randomCode .= $lowercase[mt_rand(0, $max)];
} }
$max = strlen($uppercase) - 1; $max = strlen($uppercase) - 1;
for ($x = 0; $x < $nbofchar; $x++) { for ($x = 0; $x < $nbofchar; $x++) {
$randomCode .= $uppercase{mt_rand(0, $max)}; $randomCode .= $uppercase[mt_rand(0, $max)];
} }
$max = strlen($numbers) - 1; $max = strlen($numbers) - 1;
for ($x = 0; $x < $nbofcharlast; $x++) { for ($x = 0; $x < $nbofcharlast; $x++) {
$randomCode .= $numbers{mt_rand(0, $max)}; $randomCode .= $numbers[mt_rand(0, $max)];
} }
$generated_password = str_shuffle($randomCode); $generated_password = str_shuffle($randomCode);
@ -512,11 +512,11 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len
$max = strlen($numbers) - 1; $max = strlen($numbers) - 1;
if (function_exists('random_int')) // Cryptographic random if (function_exists('random_int')) // Cryptographic random
{ {
$generated_password = str_replace($replaceambiguouschars, $numbers{random_int(0, $max)}, $generated_password); $generated_password = str_replace($replaceambiguouschars, $numbers[random_int(0, $max)], $generated_password);
} }
else else
{ {
$generated_password = str_replace($replaceambiguouschars, $numbers{mt_rand(0, $max)}, $generated_password); $generated_password = str_replace($replaceambiguouschars, $numbers[mt_rand(0, $max)], $generated_password);
} }
} }

View File

@ -35,7 +35,7 @@ function stock_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Warehouse");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -78,7 +78,7 @@ function ticket_prepare_head($object)
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id='.$object->track_id; $head[$h][0] = DOL_URL_ROOT.'/ticket/card.php?action=view&track_id='.$object->track_id;
$head[$h][1] = $langs->trans("Card"); $head[$h][1] = $langs->trans("Ticket");
$head[$h][2] = 'tabTicket'; $head[$h][2] = 'tabTicket';
$h++; $h++;
@ -230,8 +230,8 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
} elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$mysoc->logo); $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;entity='.$conf->entity.'&amp;file='.urlencode('logos/'.$mysoc->logo);
$width = 150; $width = 150;
} elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')) { } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
$urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.png'; $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
} }
} }
} }
@ -254,7 +254,7 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $
} }
print '</div>'; print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" width="80px"></a></div>'; print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
} }
print '</div>'; print '</div>';
} }

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