Merge branch 'develop' into patch-11

This commit is contained in:
Frédéric FRANCE 2023-12-08 07:55:12 +01:00 committed by GitHub
commit ec32e269d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
273 changed files with 961 additions and 941 deletions

View file

@ -268,8 +268,9 @@ before_script:
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
echo "Setting up Dolibarr '$CONF_FILE'"
echo '<?php' > $CONF_FILE
echo 'error_reporting(E_ALL);' >> $CONF_FILE
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
@ -393,6 +394,7 @@ script:
# Ensure we catch errors
set +e
echo '<?php ' > $INSTALL_FORCED_FILE
echo 'error_reporting(E_ALL);' >> $INSTALL_FORCED_FILE
echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE

View file

@ -251,7 +251,9 @@ The following changes may create regressions for some external modules, but were
* Endpoint for API /partnershipapi and /recruitment has been renamed into /partnerships and /recruitments to follow name conventions.
* Hidden option ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT has been renamed into ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USER_ON_SALARY_BANK_PAYMENT
* The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter.
* A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english.
***** ChangeLog for 18.0.3 compared to 18.0.2 *****
FIX: #25793 Cannot add time spent (#26405)
FIX: #26100 Ticket - On edit, list of closed project must be excluded (#26223)

View file

@ -626,7 +626,7 @@ class AccountancyCategory // extends CommonObject
* @param string $thirdparty_code Thirdparty code
* @param int $month Specifig month - Can be empty
* @param int $year Specifig year - Can be empty
* @return integer <0 if KO, >= 0 if OK
* @return integer Return integer <0 if KO, >= 0 if OK
*/
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0)
{

View file

@ -325,7 +325,7 @@ class AccountancyExport
* @param int $outputMode [=0] Print on screen
* or 1 to write in file and uses a temp directory - Forced by default when use withAttachment = 1
* or 2 to write in file a default export directory (accounting/export/)
* @return int <0 if KO, >0 OK
* @return int Return integer <0 if KO, >0 OK
*/
public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 0, $outputMode = 0)
{

View file

@ -117,7 +117,7 @@ class AccountancySystem
*
* @param int $rowid Id
* @param string $ref ref
* @return int <0 if KO, Id of record if OK and found
* @return int Return integer <0 if KO, Id of record if OK and found
*/
public function fetch($rowid = 0, $ref = '')
{

View file

@ -179,7 +179,7 @@ class AccountingAccount extends CommonObject
* @param string $account_number Account number
* @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active chart of account
* @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC' (better and faster than previous parameter if you have chart of account code).
* @return int <0 if KO, 0 if not found, Id of record if OK and found
* @return int Return integer <0 if KO, 0 if not found, Id of record if OK and found
*/
public function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0, $limittoachartaccount = '')
{
@ -350,7 +350,7 @@ class AccountingAccount extends CommonObject
* Update record
*
* @param User $user User making update
* @return int <0 if KO (-2 = duplicate), >0 if OK
* @return int Return integer <0 if KO (-2 = duplicate), >0 if OK
*/
public function update($user)
{

View file

@ -114,7 +114,7 @@ class AccountingJournal extends CommonObject
*
* @param int $rowid Id of record to load
* @param string $journal_code Journal code
* @return int <0 if KO, Id of record if OK and found
* @return int Return integer <0 if KO, Id of record if OK and found
*/
public function fetch($rowid = null, $journal_code = null)
{

View file

@ -869,7 +869,7 @@ class BookKeeping extends CommonObject
* @param string $filtermode filter mode (AND or OR)
* @param int $option option (0: general account or 1: subaccount)
* @param int $countonly Do not fill the $object->lines, return only the count.
* @return int <0 if KO, Number of lines if OK
* @return int Return integer <0 if KO, Number of lines if OK
*/
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $option = 0, $countonly = 0)
{
@ -2303,7 +2303,7 @@ class BookKeeping extends CommonObject
* Is the bookkeeping can be modified or deleted ?
*
* @param int $id Bookkeeping ID
* @return int <0 if KO, == 0 if No, == 1 if Yes
* @return int Return integer <0 if KO, == 0 if No, == 1 if Yes
*/
public function canModifyBookkeeping($id)
{
@ -2359,7 +2359,7 @@ class BookKeeping extends CommonObject
* Is the bookkeeping date valid (on an open period or not on a closed period) ?
*
* @param int $date Bookkeeping date
* @return int <0 if KO, == 0 if No, == 1 if date is valid for a transfer
* @return int Return integer <0 if KO, == 0 if No, == 1 if date is valid for a transfer
*/
public function validBookkeepingDate($date)
{
@ -2464,7 +2464,7 @@ class BookKeeping extends CommonObject
* Get list of fiscal period
*
* @param string $filter Filter
* @return array|int <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...]
* @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...]
*/
public function getFiscalPeriods($filter = '')
{
@ -2503,7 +2503,7 @@ class BookKeeping extends CommonObject
*
* @param int $date_start Date start
* @param int $date_end Date end
* @return array|int <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...]
* @return array|int Return integer <0 if KO, Fiscal periods : [[id, date_start, date_end, label], ...]
*/
public function getCountByMonthForFiscalPeriod($date_start, $date_end)
{

View file

@ -400,7 +400,7 @@ class Lettering extends BookKeeping
*
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
* @param bool $unlettering Do unlettering
* @return int <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered)
* @return int Return integer <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered)
*/
public function bookkeepingLetteringAll($bookkeeping_ids, $unlettering = false)
{
@ -432,7 +432,7 @@ class Lettering extends BookKeeping
*
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
* @param bool $unlettering Do unlettering
* @return int <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered)
* @return int Return integer <0 if error (nb lettered = result -1), 0 if noting to lettering, >0 if OK (nb lettered)
*/
public function bookkeepingLettering($bookkeeping_ids, $unlettering = false)
{
@ -518,7 +518,7 @@ class Lettering extends BookKeeping
*
* @param array $bookkeeping_ids Lettering specific list of bookkeeping id
* @param bool $only_has_subledger_account Get only lines who have subledger account
* @return array|int <0 if error otherwise all linked lines by block
* @return array|int Return integer <0 if error otherwise all linked lines by block
*/
public function getLinkedLines($bookkeeping_ids, $only_has_subledger_account = true)
{
@ -655,7 +655,7 @@ class Lettering extends BookKeeping
* Get all fk_doc by doc_type from list of bank ids
*
* @param array $bank_ids List of bank ids
* @return array|int <0 if error otherwise all fk_doc by doc_type
* @return array|int Return integer <0 if error otherwise all fk_doc by doc_type
*/
public function getDocTypeAndFkDocFromBankLines($bank_ids)
{
@ -698,7 +698,7 @@ class Lettering extends BookKeeping
*
* @param array $document_ids List of document id
* @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...)
* @return array|int <0 if error otherwise all all bank ids from list of document ids of a type
* @return array|int Return integer <0 if error otherwise all all bank ids from list of document ids of a type
*/
public function getBankLinesFromFkDocAndDocType($document_ids, $doc_type)
{
@ -752,7 +752,7 @@ class Lettering extends BookKeeping
*
* @param array $document_ids List of document id
* @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...)
* @return array|int <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ]
* @return array|int Return integer <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ]
*/
public function getLinkedDocumentByGroup($document_ids, $doc_type)
{

View file

@ -1026,7 +1026,7 @@ class Adherent extends CommonObject
* @param int $rowid Id of member to delete
* @param User $user User object
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, 0=nothing to do, >0 if OK
* @return int Return integer <0 if KO, 0=nothing to do, >0 if OK
*/
public function delete($rowid, $user, $notrigger = 0)
{
@ -1939,7 +1939,7 @@ class Adherent extends CommonObject
* Function that validate a member
*
* @param User $user user adherent qui valide
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function validate($user)
{
@ -2503,7 +2503,7 @@ class Adherent extends CommonObject
*
* @param User $user Objet user
* @param string $mode "expired" for membership to renew, "shift" for member to validate
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{

View file

@ -135,7 +135,7 @@ class Subscription extends CommonObject
*
* @param User $user User that create
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @return int <0 if KO, Id subscription created if OK
* @return int Return integer <0 if KO, Id subscription created if OK
*/
public function create($user, $notrigger = false)
{
@ -209,7 +209,7 @@ class Subscription extends CommonObject
* Method to load a subscription
*
* @param int $rowid Id subscription
* @return int <0 if KO, =0 if not found, >0 if OK
* @return int Return integer <0 if KO, =0 if not found, >0 if OK
*/
public function fetch($rowid)
{

View file

@ -1428,7 +1428,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -181,7 +181,7 @@ foreach ($dirbarcode as $reldir) {
}
if ($module->isEnabled()) {
$barcodelist[$filebis] = $module->info();
$barcodelist[$filebis] = $module->info($langs);
}
}
}

View file

@ -736,7 +736,7 @@ print '<br>';
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -686,7 +686,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -174,13 +174,6 @@ if (in_array($functiontokeep, $arrayoffunctionsdisabled)) {
print '<span class="opacitymedium">'.$functiontokeep.'</span>';
print '<br>';
$arrayofstreams = stream_get_wrappers();
if (!empty($arrayofstreams)) {
sort($arrayofstreams);
print "<strong>PHP streams</strong> = ".(join(',', $arrayofstreams)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'file,http,https,php').')</span>'."<br>\n";
}
print '<br>';
// XDebug
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
@ -305,21 +298,21 @@ print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', ''
print '<strong>$dolibarr_main_prod</strong>: '.($dolibarr_main_prod ? $dolibarr_main_prod : '0');
if (empty($dolibarr_main_prod)) {
print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
print ' &nbsp; &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
}
print '<br>';
print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
if (!empty($dolibarr_nocsrfcheck)) {
print ' &nbsp; '.img_picto('', 'error').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
print ' &nbsp; &nbsp;'.img_picto('', 'error').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
} else {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span>';
print ' &nbsp; &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span>';
}
print '<br>';
print '<strong>$dolibarr_main_restrict_ip</strong>: ';
if (empty($dolibarr_main_restrict_ip)) {
print $langs->trans("None");
print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
} else {
print $dolibarr_main_restrict_ip;
@ -332,13 +325,13 @@ if (empty($dolibarr_main_restrict_os_commands)) {
} else {
print $dolibarr_main_restrict_os_commands;
}
print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump, clamdscan').')</span>';
print ' &nbsp; &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'mysqldump, mysql, pg_dump, pgrestore, mariadb, mariadb-dump, clamdscan').')</span>';
print '<br>';
if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) {
print '<strong>$dolibarr_main_db_pass</strong>: ';
if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' &nbsp; &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
} else {
print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated");
@ -347,7 +340,39 @@ if (!getDolGlobalString('SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF')) {
print '<br>';
}
print '<strong>$dolibarr_main_stream_to_disable</strong>: ';
if (empty($dolibarr_main_stream_to_disable)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").' = '.join(', ', $arrayofstreamtodisable).'</span>';
} else {
print join(', ', $dolibarr_main_stream_to_disable);
}
print '<span class="bold"> -> PHP streams allowed = </span>';
$arrayofstreams = stream_get_wrappers();
if (!empty($arrayofstreams)) {
sort($arrayofstreams);
print (join(',', $arrayofstreams)).' &nbsp; &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("TryToKeepOnly", 'file,http,https,php').')</span>'."\n";
}
print '<br>';
/*
if (!empty($dolibarr_main_stream_do_not_disable)) {
print '<strong>$dolibarr_main_stream_do_not_disable</strong>: ';
if (empty($dolibarr_main_stream_do_not_disable)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
} else {
print join(', ', $dolibarr_main_stream_do_not_disable);
}
print ' -> PHP stream allowed = ';
$arrayofstreams = stream_get_wrappers();
if (!empty($arrayofstreams)) {
sort($arrayofstreams);
print (join(',', $arrayofstreams)).' &nbsp; &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Undefined').')</span>'."\n";
}
print '<br>';
}
*/
// Menu Home - Setup - Security

View file

@ -501,10 +501,12 @@ if ($result) {
print dol_escape_htmltag($obj->user_agent);
print '</td>';
// User agent
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->prefix_session).'">';
print dol_escape_htmltag($obj->prefix_session);
print '</td>';
// Prefix
if (!empty($arrayfields['e.prefix_session']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->prefix_session).'">';
print dol_escape_htmltag($obj->prefix_session);
print '</td>';
}
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {

View file

@ -700,7 +700,7 @@ class Asset extends CommonObject
/**
* If has depreciation lines in bookkeeping
*
* @return int <0 if KO, 0 if NO, 1 if Yes
* @return int Return integer <0 if KO, 0 if NO, 1 if Yes
*/
public function hasDepreciationLinesInBookkeeping()
{
@ -763,7 +763,7 @@ class Asset extends CommonObject
* @param double $cumulative_depreciation_ht Depreciation cumulative amount HT
* @param string $accountancy_code_debit Accountancy code Debit
* @param string $accountancy_code_credit Accountancy code Credit
* @return int <0 if KO, Id of created line if OK
* @return int Return integer <0 if KO, Id of created line if OK
*/
public function addDepreciationLine($mode, $ref, $depreciation_date, $depreciation_ht, $cumulative_depreciation_ht, $accountancy_code_debit, $accountancy_code_credit)
{
@ -1014,6 +1014,8 @@ class Asset extends CommonObject
$nb_days_in_month = getDolGlobalString('ASSET_DEPRECIATION_DURATION_PER_MONTH') ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_MONTH : 30;
$period_amount = (float) price2num($depreciation_period_amount / $fields['duration'], 'MT');
$first_period_found = false;
// TODO fix declaration of $begin_period
// @phpstan-ignore-next-line
$first_period_date = isset($begin_period) && $begin_period > $fiscal_period_start ? $begin_period : $fiscal_period_start;
$ref_date_format = "%Y" . ($fields['duration_type'] == 1 || $fields['duration_type'] == 2 ? '-%m' : '') . ($fields['duration_type'] == 2 ? '-%d' : '');
@ -1171,7 +1173,7 @@ class Asset extends CommonObject
* @param User $user Object user that dispose
* @param int $disposal_invoice_id Disposal invoice ID
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function dispose($user, $disposal_invoice_id, $notrigger = 0)
{
@ -1239,7 +1241,7 @@ class Asset extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -377,7 +377,7 @@ class AssetDepreciationOptions extends CommonObject
* get general depreciation info for a mode (used in depreciation card)
*
* @param string $mode Depreciation mode (economic, accelerated_depreciation, ...)
* @return array|int <0 if KO otherwise array with general depreciation info
* @return array|int Return integer <0 if KO otherwise array with general depreciation info
*/
public function getGeneralDepreciationInfoForMode($mode)
{

View file

@ -436,7 +436,7 @@ class AssetModel extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if OK, 0=Nothing done, >0 if KO
* @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@ -519,7 +519,7 @@ class AssetModel extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@ -536,7 +536,7 @@ class AssetModel extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -664,7 +664,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -667,7 +667,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -832,7 +832,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -708,7 +708,7 @@ class BOM extends CommonObject
* @param int $fk_unit Unit of line
* @param array $array_options extrafields array
* @param int $fk_default_workstation Default workstation
* @return int <0 if KO, Id of updated BOM-Line if OK
* @return int Return integer <0 if KO, Id of updated BOM-Line if OK
*/
public function updateLine($rowid, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $import_key = null, $fk_unit = 0, $array_options = 0, $fk_default_workstation = null)
{
@ -915,7 +915,7 @@ class BOM extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if OK, 0=Nothing done, >0 if KO
* @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@ -1066,7 +1066,7 @@ class BOM extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@ -1090,7 +1090,7 @@ class BOM extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -795,7 +795,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -815,7 +815,7 @@ print '</div>'."\n";
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -509,7 +509,7 @@ class Availabilities extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if OK, 0=Nothing done, >0 if KO
* @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@ -666,7 +666,7 @@ class Availabilities extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@ -690,7 +690,7 @@ class Availabilities extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -466,7 +466,7 @@ class Calendar extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if OK, 0=Nothing done, >0 if KO
* @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@ -623,7 +623,7 @@ class Calendar extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@ -647,7 +647,7 @@ class Calendar extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -148,7 +148,7 @@ class Bookmark extends CommonObject
/**
* Insert bookmark into database
*
* @return int <0 si ko, rowid du bookmark cree si ok
* @return int Return integer <0 si ko, rowid du bookmark cree si ok
*/
public function create()
{
@ -201,7 +201,7 @@ class Bookmark extends CommonObject
/**
* Update bookmark record
*
* @return int <0 if KO, > if OK
* @return int Return integer <0 if KO, > if OK
*/
public function update()
{

View file

@ -542,6 +542,8 @@ class Categorie extends CommonObject
*/
public function update(User $user)
{
global $langs;
$error = 0;
// Clean parameters
@ -612,7 +614,7 @@ class Categorie extends CommonObject
*
* @param User $user Object user that ask to delete
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 KO >0 OK
* @return int Return integer <0 KO >0 OK
*/
public function delete($user, $notrigger = 0)
{
@ -1055,7 +1057,7 @@ class Categorie extends CommonObject
/**
* Return direct childs id of a category into an array
*
* @return array|int <0 KO, array ok
* @return array|int Return integer <0 KO, array ok
*/
public function get_filles()
{
@ -1437,7 +1439,7 @@ class Categorie extends CommonObject
/**
* Returns an array containing the list of parent categories
*
* @return int|array <0 KO, array OK
* @return int|array Return integer <0 KO, array OK
*/
public function get_meres()
{

View file

@ -1744,7 +1744,7 @@ if ($id > 0) {
$object->percentage = $percentage;
$object->priority = GETPOST("priority", "alphanohtml");
$object->fulldayevent = GETPOST("fullday") ? 1 : 0;
$object->location = GETPOST('location', "alpanohtml");
$object->location = GETPOST('location', "alphanohtml");
$object->socid = GETPOST("socid", "int");
$socpeopleassigned = GETPOST("socpeopleassigned", 'array');
foreach ($socpeopleassigned as $tmpid) {

View file

@ -1408,7 +1408,7 @@ class ActionComm extends CommonObject
*
* @param User $user Objet user
* @param int $load_state_board Load indicator array this->nb
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $load_state_board = 0)
{

View file

@ -2278,7 +2278,7 @@ function dol_color_minus($color, $minus, $minusunit = 16)
*
* @param object $a Event A
* @param object $b Event B
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
* @return int Return integer < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
*/
function sort_events_by_date($a, $b)
{
@ -2317,7 +2317,7 @@ function sort_events_by_date($a, $b)
*
* @param object $a Event A
* @param object $b Event B
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same percentage
* @return int Return integer < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same percentage
*/
function sort_events_by_percentage($a, $b)
{

View file

@ -308,7 +308,7 @@ class Mailing extends CommonObject
*
* @param User $user Object of user making change
* @param int $notrigger Disable triggers
* @return int < 0 if KO, > 0 if OK
* @return int Return integer < 0 if KO, > 0 if OK
*/
public function update($user, $notrigger = 0)
{

View file

@ -1058,7 +1058,7 @@ class Propal extends CommonObject
*
* @param User $user User that create
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function create($user, $notrigger = 0)
{
@ -1970,7 +1970,7 @@ class Propal extends CommonObject
*
* @param User $user Object user that validate
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if KO, 0=Nothing done, >=0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >=0 if OK
*/
public function valid($user, $notrigger = 0)
{
@ -2220,7 +2220,7 @@ class Propal extends CommonObject
* @param User $user Object user that modify
* @param int $delivery_date Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
* @deprecated Use setDeliveryDate
*/
public function set_date_livraison($user, $delivery_date, $notrigger = 0)
@ -2235,7 +2235,7 @@ class Propal extends CommonObject
* @param User $user Object user that modify
* @param int $delivery_date Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function setDeliveryDate($user, $delivery_date, $notrigger = 0)
{
@ -2420,7 +2420,7 @@ class Propal extends CommonObject
* @param User $user Object user that modify
* @param string $ref_client Customer reference
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function set_ref_client($user, $ref_client, $notrigger = 0)
{
@ -2477,7 +2477,7 @@ class Propal extends CommonObject
* @param User $user Object user that modify
* @param double $remise Amount discount
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
* @deprecated remise_percent is a deprecated field for object parent
*/
/*
@ -2542,7 +2542,7 @@ class Propal extends CommonObject
* @param User $user Object user that modify
* @param double $remise Amount discount
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
/*
public function set_remise_absolue($user, $remise, $notrigger = 0)
@ -2780,7 +2780,7 @@ class Propal extends CommonObject
* @param User $user Object user
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param string $note Complete private note with this note
* @return int <0 if KO, 0 = nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 = nothing done, >0 if OK
*/
public function classifyBilled(User $user, $notrigger = 0, $note = '')
{
@ -3447,7 +3447,7 @@ class Propal extends CommonObject
*
* @param User $user Object user
* @param string $mode "opened" for proposal to close, "signed" for proposal to invoice
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{
@ -3622,7 +3622,7 @@ class Propal extends CommonObject
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function load_state_board()
{
@ -4442,7 +4442,7 @@ class PropaleLigne extends CommonObjectLine
*
* @param User $user Object user
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function delete(User $user, $notrigger = 0)
{
@ -4492,7 +4492,7 @@ class PropaleLigne extends CommonObjectLine
* Update propal line object into DB
*
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function update($notrigger = 0)
{

View file

@ -2392,7 +2392,7 @@ if ($search_date_signature_endyear) {
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -463,7 +463,7 @@ class Commande extends CommonOrder
* @param User $user User making status change
* @param int $idwarehouse Id of warehouse to use for stock decrease
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function valid($user, $idwarehouse = 0, $notrigger = 0)
{
@ -713,7 +713,7 @@ class Commande extends CommonOrder
* Function used when order is reopend after being closed.
*
* @param User $user Object user that change status
* @return int <0 if KO, 0 if nothing is done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing is done, >0 if OK
*/
public function set_reopen($user)
{
@ -1313,7 +1313,7 @@ class Commande extends CommonOrder
*
* @param Object $object Object source
* @param User $user User making creation
* @return int <0 if KO, 0 if nothing done, 1 if OK
* @return int Return integer <0 if KO, 0 if nothing done, 1 if OK
*/
public function createFromProposal($object, User $user)
{
@ -2205,7 +2205,7 @@ class Commande extends CommonOrder
/**
* Return number of line with type product.
*
* @return int <0 if KO, Nbr of product lines if OK
* @return int Return integer <0 if KO, Nbr of product lines if OK
*/
public function getNbOfProductsLines()
{
@ -2221,7 +2221,7 @@ class Commande extends CommonOrder
/**
* Return number of line with type service.
*
* @return int <0 if KO, Nbr of service lines if OK
* @return int Return integer <0 if KO, Nbr of service lines if OK
*/
public function getNbOfServicesLines()
{
@ -2237,7 +2237,7 @@ class Commande extends CommonOrder
/**
* Count number of shipments for this order
*
* @return int <0 if KO, Nb of shipment found if OK
* @return int Return integer <0 if KO, Nb of shipment found if OK
*/
public function getNbOfShipments()
{
@ -2273,7 +2273,7 @@ class Commande extends CommonOrder
*
* @param int $filtre_statut Filter on shipment status
* @param int $fk_product Add a filter on a product
* @return int <0 if KO, Nb of lines found if OK
* @return int Return integer <0 if KO, Nb of lines found if OK
*/
public function loadExpeditions($filtre_statut = -1, $fk_product = 0)
{
@ -2649,7 +2649,7 @@ class Commande extends CommonOrder
* @param User $user Object user that modify
* @param int $delivery_date Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
* @deprecated Use setDeliveryDate
*/
public function set_date_livraison($user, $delivery_date, $notrigger = 0)
@ -2664,7 +2664,7 @@ class Commande extends CommonOrder
* @param User $user Objet utilisateur qui modifie
* @param int $delivery_date Delivery date
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function setDeliveryDate($user, $delivery_date, $notrigger = 0)
{
@ -2977,7 +2977,7 @@ class Commande extends CommonOrder
*
* @param User $user Object user making the change
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if KO, 0 if already billed, >0 if OK
* @return int Return integer <0 if KO, 0 if already billed, >0 if OK
*/
public function classifyBilled(User $user, $notrigger = 0)
{
@ -3031,7 +3031,7 @@ class Commande extends CommonOrder
*
* @param User $user Object user making the change
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function classifyUnBilled(User $user, $notrigger = 0)
{
@ -3107,7 +3107,7 @@ class Commande extends CommonOrder
* @param int $notrigger disable line update trigger
* @param string $ref_ext external reference
* @param integer $rang line rank
* @return int < 0 if KO, > 0 if OK
* @return int Return integer < 0 if KO, > 0 if OK
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $price_base_type = 'HT', $info_bits = 0, $date_start = '', $date_end = '', $type = 0, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang = 0)
{
@ -3430,7 +3430,7 @@ class Commande extends CommonOrder
*
* @param User $user User object
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
public function delete($user, $notrigger = 0)
{
@ -3562,7 +3562,7 @@ class Commande extends CommonOrder
*
* @param User $user Object user
* @param string $mode Mode ('toship', 'tobill', 'shippedtobill')
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{
@ -4064,7 +4064,7 @@ class Commande extends CommonOrder
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function load_state_board()
{
@ -4387,7 +4387,7 @@ class OrderLine extends CommonOrderLine
*
* @param User $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function delete(User $user, $notrigger = 0)
{
@ -4638,7 +4638,7 @@ class OrderLine extends CommonOrderLine
*
* @param User $user User that modify
* @param int $notrigger 1 = disable triggers
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function update(User $user, $notrigger = 0)
{

View file

@ -2774,7 +2774,7 @@ if ($num == 0) {
print '</form>'."\n";
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -66,10 +66,10 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$contextpage = 'banktransactionlist';
$contextpage = 'bankentrieslist';
$massaction = GETPOST('massaction', 'alpha');
$optioncss = GETPOST('optioncss', 'aZ09');
$mode = GETPOST('mode', 'aZ');
$dateop = dol_mktime(12, 0, 0, GETPOST("opmonth", 'int'), GETPOST("opday", 'int'), GETPOST("opyear", 'int'));
$search_debit = GETPOST("search_debit", 'alpha');
@ -1819,10 +1819,10 @@ if ($resql) {
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
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->rowid, $arrayofselected)) {
if (in_array($objp->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
print '<input id="cb'.$objp->rowid.'" class="flat checkforselect marginleftonly" type="checkbox" name="toselect[]" value="'.$objp->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) {

View file

@ -452,7 +452,7 @@ class Account extends CommonObject
* @param string $url Url (deprecated, we use now 'url_id' and 'type' instead)
* @param string $label Link label
* @param string $type Type of link ('payment', 'company', 'member', ...)
* @return int <0 if KO, id line if OK
* @return int Return integer <0 if KO, id line if OK
*/
public function add_url_line($line_id, $url_id, $url, $label, $type)
{
@ -667,7 +667,7 @@ class Account extends CommonObject
*
* @param User $user Object user making creation
* @param int $notrigger 1=Disable triggers
* @return int < 0 if KO, > 0 if OK
* @return int Return integer < 0 if KO, > 0 if OK
*/
public function create(User $user, $notrigger = 0)
{
@ -1285,7 +1285,7 @@ class Account extends CommonObject
*
* @param User $user Objet user
* @param int $filteraccountid To get info for a particular account id
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board(User $user, $filteraccountid = 0)
{
@ -2035,7 +2035,7 @@ class AccountLine extends CommonObjectLine
* @param int $rowid Id of bank transaction to load
* @param string $ref Ref of bank transaction to load
* @param string $num External num to load (ex: num of transaction for paypal fee)
* @return int <0 if KO, 0 if OK but not found, >0 if OK and found
* @return int Return integer <0 if KO, 0 if OK but not found, >0 if OK and found
*/
public function fetch($rowid, $ref = '', $num = '')
{
@ -2110,7 +2110,7 @@ class AccountLine extends CommonObjectLine
/**
* Inserts a transaction to a bank account
*
* @return int <0 if KO, rowid of the line if OK
* @return int Return integer <0 if KO, rowid of the line if OK
*/
public function insert()
{
@ -2677,7 +2677,7 @@ class AccountLine extends CommonObjectLine
/**
* Return if a bank line was dispatched into bookkeeping
*
* @return int <0 if KO, 0=no, 1=yes
* @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{

View file

@ -566,4 +566,37 @@ class BankAccounts extends DolibarrApi
}
return $result;
}
/**
* Get the list of links for a line of the account.
*
* @param int $id ID of account
* @param int $line_id ID of account line
* @return array Array of links
*
* @throws RestException
*
* @url GET {id}/lines/{line_id}/links
*
*/
public function getLinks($id, $line_id)
{
$list = array();
if (!DolibarrApiAccess::$user->rights->banque->lire) {
throw new RestException(401);
}
$account = new Account($this->db);
$result = $account->fetch($id);
if (!$result) {
throw new RestException(404, 'account not found');
}
$links = $account->get_url($line_id); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
foreach ($links as &$link) {
unset($link[0], $link[1], $link[2], $link[3]); // Remove the numeric keys
}
return $links;
}
}

View file

@ -760,7 +760,7 @@ class PaymentVarious extends CommonObject
/**
* Return if a various payment linked to a bank line id was dispatched into bookkeeping
*
* @return int <0 if KO, 0=no, 1=yes
* @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{

View file

@ -52,7 +52,7 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bankaccountlist'; // To manage different context of search
$mode = GETPOST('mode', 'alpha');
$mode = GETPOST('mode', 'aZ');
$search_ref = GETPOST('search_ref', 'alpha');
$search_label = GETPOST('search_label', 'alpha');

View file

@ -721,7 +721,7 @@ print '</div>'."\n";
print '</form>'."\n";
/*
if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
$hidegeneratedfilelistifempty = 1;
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
$hidegeneratedfilelistifempty = 0;

View file

@ -154,7 +154,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
print "</tr>\n";
$sql = "SELECT c.id, c.libelle as label,";
$sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
$sql .= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode as period, cs.date_ech, cs.amount as total,";
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
$sql .= " pct.code as payment_code,";
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
@ -168,8 +168,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
$sql .= " AND cs.entity IN (".getEntity("tax").")";
if ($year > 0) {
$sql .= " AND (";
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
// If period defined, we use it as dat criteria, if not we use date echeance,
// so we are compatible when period is not mandatory
$sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')";
$sql .= ")";
@ -190,9 +190,10 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
// Date
$date = $obj->periode;
$date = $obj->period;
if (empty($date)) {
$date = $obj->date_ech;
}
@ -284,8 +285,8 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON ptva.fk_typepaiement = pct.id";
$sql .= " WHERE pv.entity IN (".getEntity("tax").")";
if ($year > 0) {
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
// If period defined, we use it as dat criteria, if not we use date echeance,
// so we are compatible when period is not mandatory
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
}
if (preg_match('/^pv\./', $sortfield) || preg_match('/^ptva\./', $sortfield)) {
@ -409,8 +410,8 @@ while ($j < $numlt) {
$sql .= " FROM ".MAIN_DB_PREFIX."localtax as pv";
$sql .= " WHERE pv.entity = ".$conf->entity." AND localtaxtype = ".((int) $j);
if ($year > 0) {
// Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance,
// ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire
// If period defined, we use it as dat criteria, if not we use date echeance,
// so we are compatible when period is not mandatory
$sql .= " AND pv.datev between '".$db->idate(dol_get_first_day($year, 1, false))."' AND '".$db->idate(dol_get_last_day($year, 12, false))."'";
}
if (preg_match('/^pv/', $sortfield)) {

View file

@ -235,7 +235,7 @@ class FactureRec extends CommonInvoice
* @param int $facid Id of source invoice
* @param int $notrigger No trigger
* @param array $onlylines Only the lines of the array
* @return int <0 if KO, id of invoice created if OK
* @return int Return integer <0 if KO, id of invoice created if OK
*/
public function create($user, $facid, $notrigger = 0, $onlylines = array())
{
@ -484,7 +484,7 @@ class FactureRec extends CommonInvoice
*
* @param User $user User
* @param int $notrigger No trigger
* @return int <0 if KO, Id of line if OK
* @return int Return integer <0 if KO, Id of line if OK
*/
public function update(User $user, $notrigger = 0)
{
@ -871,7 +871,7 @@ class FactureRec extends CommonInvoice
* @param int $fk_fournprice Supplier price id (to calculate margin) or ''
* @param int $pa_ht Buying price of line (to calculate margin) or ''
* @param int $fk_parent_line Id of parent line
* @return int <0 if KO, Id of line if OK
* @return int Return integer <0 if KO, Id of line if OK
*/
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0, $fk_parent_line = 0)
{
@ -1078,7 +1078,7 @@ class FactureRec extends CommonInvoice
* @param int $fk_fournprice Id of origin supplier price
* @param int $pa_ht Price (without tax) of product for margin calculation
* @param int $fk_parent_line Id of parent line
* @return int <0 if KO, Id of line if OK
* @return int Return integer <0 if KO, Id of line if OK
*/
public function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0, $fk_parent_line = 0)
{
@ -2309,7 +2309,7 @@ class FactureLigneRec extends CommonInvoiceLine
*
* @param User $user User
* @param int $notrigger No trigger
* @return int <0 if KO, Id of line if OK
* @return int Return integer <0 if KO, Id of line if OK
*/
public function update(User $user, $notrigger = 0)
{

View file

@ -1360,7 +1360,7 @@ class Facture extends CommonInvoice
*
* @param Object $object Object source
* @param User $user Object user
* @return int <0 if KO, 0 if nothing done, 1 if OK
* @return int Return integer <0 if KO, 0 if nothing done, 1 if OK
*/
public function createFromOrder($object, User $user)
{
@ -1490,7 +1490,7 @@ class Facture extends CommonInvoice
* @param Object $object Object source
* @param User $user Object user
* @param array $lines Ids of lines to use for invoice. If empty, all lines will be used.
* @return int <0 if KO, 0 if nothing done, 1 if OK
* @return int Return integer <0 if KO, 0 if nothing done, 1 if OK
*/
public function createFromContract($object, User $user, $lines = array())
{
@ -2742,7 +2742,7 @@ class Facture extends CommonInvoice
* @param User $user User making the deletion.
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param int $idwarehouse Id warehouse to use for stock change.
* @return int <0 if KO, 0=Refused, >0 if OK
* @return int Return integer <0 if KO, 0=Refused, >0 if OK
*/
public function delete($user, $notrigger = 0, $idwarehouse = -1)
{
@ -3160,7 +3160,7 @@ class Facture extends CommonInvoice
* @param int $idwarehouse Id of warehouse to use for stock decrease if option to decreasenon stock is on (0=no decrease)
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @param int $batch_rule 0=do not decrement batch, else batch rule to use, 1=take in batches ordered by sellby and eatby dates
* @return int <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK
*/
public function validate($user, $force_number = '', $idwarehouse = 0, $notrigger = 0, $batch_rule = 0)
{
@ -3772,7 +3772,7 @@ class Facture extends CommonInvoice
* @param double $pu_ht_devise Unit price in foreign currency
* @param string $ref_ext External reference of the line
* @param int $noupdateafterinsertline No update after insert of line
* @return int <0 if KO, Id of line if OK
* @return int Return integer <0 if KO, Id of line if OK
*/
public function addline(
$desc,
@ -4068,7 +4068,7 @@ class Facture extends CommonInvoice
* @param int $notrigger disable line update trigger
* @param string $ref_ext External reference of the line
* @param integer $rang rank of line
* @return int < 0 if KO, > 0 if OK
* @return int Return integer < 0 if KO, > 0 if OK
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = self::TYPE_STANDARD, $fk_parent_line = 0, $skip_update_total = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $special_code = 0, $array_options = 0, $situation_percent = 100, $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $ref_ext = '', $rang = 0)
{
@ -4908,7 +4908,7 @@ class Facture extends CommonInvoice
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Object user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user)
{

View file

@ -467,7 +467,7 @@ class Localtax extends CommonObject
* Add a payment of localtax
*
* @param User $user Object user that insert
* @return int <0 if KO, rowid in localtax table if OK
* @return int Return integer <0 if KO, rowid in localtax table if OK
*/
public function addPayment($user)
{

View file

@ -86,7 +86,7 @@ class RemiseCheque extends CommonObject
*
* @param int $id Id record
* @param string $ref Ref record
* @return int <0 if KO, > 0 if OK
* @return int Return integer <0 if KO, > 0 if OK
*/
public function fetch($id, $ref = '')
{
@ -475,7 +475,7 @@ class RemiseCheque extends CommonObject
*
* @param User $user Objet user
* @param string $type Type of payment mode deposit ('CHQ', 'TRA', ...)
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $type = 'CHQ')
{
@ -529,7 +529,7 @@ class RemiseCheque extends CommonObject
* Charge indicateurs this->nb de tableau de bord
*
* @param string $type Type of payment mode deposit ('CHQ', 'TRA', ...)
* @return int <0 if ko, >0 if ok
* @return int Return integer <0 if ko, >0 if ok
*/
public function load_state_board($type = 'CHQ')
{

View file

@ -649,7 +649,7 @@ class Paiement extends CommonObject
* @param int $notrigger No trigger
* @param string $accountancycode When we record a free bank entry, we must provide accounting account if accountancy module is on.
* @param string $addbankurl 'direct-debit' or 'credit-transfer': Add another entry into bank_url.
* @return int <0 if KO, bank_line_id if OK
* @return int Return integer <0 if KO, bank_line_id if OK
*/
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0, $accountancycode = '', $addbankurl = '')
{
@ -867,7 +867,7 @@ class Paiement extends CommonObject
* Updates the payment date
*
* @param int $date New date
* @return int <0 if KO, 0 if OK
* @return int Return integer <0 if KO, 0 if OK
*/
public function update_date($date)
{
@ -924,7 +924,7 @@ class Paiement extends CommonObject
* Updates the payment number
*
* @param string $num_payment New num
* @return int <0 if KO, 0 if OK
* @return int Return integer <0 if KO, 0 if OK
*/
public function update_num($num_payment)
{
@ -1037,7 +1037,7 @@ class Paiement extends CommonObject
* Return list of invoices the payment is related to.
*
* @param string $filter Filter
* @return int|array <0 if KO or array of invoice id
* @return int|array Return integer <0 if KO or array of invoice id
* @see getAmountsArray()
*/
public function getBillsArray($filter = '')

View file

@ -744,7 +744,7 @@ class BonPrelevement extends CommonObject
*
* @param string $mode 'direct-debit' or 'bank-transfer'
* @param string $type for type=salary
* @return double <O if KO, Total amount
* @return double Return integer <O if KO, Total amount
*/
public function SommeAPrelever($mode = 'direct-debit', $type = '')
{
@ -801,7 +801,7 @@ class BonPrelevement extends CommonObject
*
* @param string $mode 'direct-debit' or 'bank-transfer'
* @param string $type for salary invoice
* @return int <O if KO, number of invoices if OK
* @return int Return integer <O if KO, number of invoices if OK
*/
public function nbOfInvoiceToPay($mode = 'direct-debit', $type = '')
{
@ -818,7 +818,7 @@ class BonPrelevement extends CommonObject
*
* @param string $type 'direct-debit' or 'bank-transfer'
* @param int $forsalary 0= for facture & facture_supplier, 1=for salary
* @return int <O if KO, number of invoices if OK
* @return int Return integer <O if KO, number of invoices if OK
*/
public function NbFactureAPrelever($type = 'direct-debit', $forsalary = 0)
{
@ -900,7 +900,7 @@ class BonPrelevement extends CommonObject
* @param int $did ID of an existing payment request. If $did is defined, we use the existing payment request.
* @param int $fk_bank_account Bank account ID the receipt is generated for. Will use the ID into the setup of module Direct Debit or Credit Transfer if 0.
* @param int $sourcetype 'invoice' or 'salary'
* @return int <0 if KO, No of invoice included into file if OK
* @return int Return integer <0 if KO, No of invoice included into file if OK
*/
public function create($banque = 0, $agence = 0, $mode = 'real', $format = 'ALL', $executiondate = '', $notrigger = 0, $type = 'direct-debit', $did = 0, $fk_bank_account = 0, $sourcetype = 'invoice')
{
@ -2618,7 +2618,7 @@ class BonPrelevement extends CommonObject
*
* @param User $user Objet user
* @param string $mode Mode 'direct_debit' or 'credit_transfer'
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{

View file

@ -98,7 +98,7 @@ class LignePrelevement
* Recupere l'objet prelevement
*
* @param int $rowid Id de la facture a recuperer
* @return integer <0 if KO, >=0 if OK
* @return integer Return integer <0 if KO, >=0 if OK
*/
public function fetch($rowid)
{

View file

@ -201,6 +201,7 @@ if (empty($reshook)) {
$object->label = GETPOST('label', 'alpha');
$object->date_ech = $dateech;
$object->periode = $dateperiod;
$object->period = $dateperiod;
$object->amount = $amount;
$object->fk_user = $fk_user;
$object->mode_reglement_id = (int) GETPOST('mode_reglement_id', 'int');
@ -236,6 +237,7 @@ if (empty($reshook)) {
$object->date_ech = $dateech;
$object->periode = $dateperiod;
$object->period = $dateperiod;
$object->amount = $amount;
$object->fk_user = $fk_user;
@ -271,6 +273,7 @@ if (empty($reshook)) {
if (GETPOST('clone_for_next_month', 'int')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set
$object->periode = dol_time_plus_duree($object->periode, 1, 'm');
$object->period = dol_time_plus_duree($object->periode, 1, 'm');
$object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm');
} else {
// Note date_ech is often a little bit higher than dateperiod
@ -278,6 +281,7 @@ if (empty($reshook)) {
$newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int'));
if ($newdateperiod) {
$object->periode = $newdateperiod;
$object->period = $newdateperiod;
if (empty($newdateech)) {
$object->date_ech = $object->periode;
}
@ -288,6 +292,7 @@ if (empty($reshook)) {
// TODO We can here get dol_get_last_day of previous month:
// $object->periode = dol_get_last_day(year of $object->date_ech - 1m, month or $object->date_ech -1m)
$object->periode = $object->date_ech;
$object->period = $object->date_ech;
}
}
}

View file

@ -66,7 +66,11 @@ class ChargeSociales extends CommonObject
public $type_label;
public $amount;
public $paye;
/**
* @deprecated
*/
public $periode;
public $period;
/**
* @var integer|string date_creation
@ -144,12 +148,12 @@ class ChargeSociales extends CommonObject
*
* @param int $id Id
* @param string $ref Ref
* @return int <0 KO >0 OK
* @return int Return integer <0 KO >0 OK
*/
public function fetch($id, $ref = '')
{
$sql = "SELECT cs.rowid, cs.date_ech";
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode as period, cs.import_key";
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private";
$sql .= ", c.libelle as type_label";
$sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
@ -186,7 +190,8 @@ class ChargeSociales extends CommonObject
$this->note_public = $obj->note_public;
$this->note_private = $obj->note_private;
$this->paye = $obj->paye;
$this->periode = $this->db->jdate($obj->periode);
$this->periode = $this->db->jdate($obj->period);
$this->period = $this->db->jdate($obj->period);
$this->import_key = $this->import_key;
$this->db->free($resql);
@ -211,7 +216,7 @@ class ChargeSociales extends CommonObject
$newamount = price2num($this->amount, 'MT');
// Validation of parameters
if ($newamount == 0 || empty($this->date_ech) || empty($this->periode)) {
if ($newamount == 0 || empty($this->date_ech) || (empty($this->period) && empty($this->periode))) {
return false;
}
@ -222,7 +227,7 @@ class ChargeSociales extends CommonObject
* Create a social contribution into database
*
* @param User $user User making creation
* @return int <0 if KO, id if OK
* @return int Return integer <0 if KO, id if OK
*/
public function create($user)
{
@ -744,6 +749,7 @@ class ChargeSociales extends CommonObject
$this->date_creation = dol_now();
$this->date_ech = $this->date_creation + 3600 * 24 * 30;
$this->periode = $this->date_creation + 3600 * 24 * 30;
$this->period = $this->date_creation + 3600 * 24 * 30;
$this->amount = 100;
$this->label = 'Social contribution label';
$this->type = 1;

View file

@ -153,7 +153,7 @@ class PaymentSocialContribution extends CommonObject
*
* @param User $user User making payment
* @param int $closepaidcontrib 1=Also close paid contributions to paid, 0=Do nothing more
* @return int <0 if KO, id of payment if OK
* @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $closepaidcontrib = 0)
{
@ -802,7 +802,7 @@ class PaymentSocialContribution extends CommonObject
/**
* Return if object was dispatched into bookkeeping
*
* @return int <0 if KO, 0=no, 1=yes
* @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{

View file

@ -154,7 +154,7 @@ class PaymentVAT extends CommonObject
*
* @param User $user User making payment
* @param int $closepaidvat 1=Also close paid contributions to paid, 0=Do nothing more
* @return int <0 if KO, id of payment if OK
* @return int Return integer <0 if KO, id of payment if OK
*/
public function create($user, $closepaidvat = 0)
{

View file

@ -559,7 +559,7 @@ class Tva extends CommonObject
* Create in database
*
* @param User $user Object user that insert
* @return int <0 if KO, rowid in tva table if OK
* @return int Return integer <0 if KO, rowid in tva table if OK
*/
public function addPayment($user)
{

View file

@ -349,6 +349,14 @@ $dolibarr_cron_allow_cli='0';
//
// $dolibarr_mailing_limit_sendbycli='0';
// dolibarr_main_stream_to_disable
// ================================
// Can set a list of PHP stream to disable.
// Default value: array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zip', 'zlib')
// Examples: array('ftp', 'ftps')
//
// $dolibarr_main_stream_to_disable = array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zip', 'zlib');
// MAIN_ANTIVIRUS_COMMAND (as a constant)
// ======================
// Force a value for the antivirus command line tool so setup for admin user interface has no effect.
@ -378,8 +386,8 @@ $dolibarr_cron_allow_cli='0';
// =========================
// If this value is set to a value, it forces the creation of a file install.lock once an upgrade process into a new version end.
// The value is the octal value of permission to set on created file.
// The file install.lock prevents the use of the migration process another time. You will have to delete it manually for
// next upgrade.
// The file install.lock prevents the use of the install and upgrade process another time. You will have to delete it manually for
// next install process or create a upgrade.unlock for next upgrade.
// Default value: '0'
// Example: '444';
// $force_install_lockinstall='440';

View file

@ -883,7 +883,7 @@ class Contact extends CommonObject
* @param int $id Id of contact
* @param User $user User asking to change alert or birthday
* @param int $notrigger 0=no, 1=yes
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function update_perso($id, $user = null, $notrigger = 0)
{
@ -1178,7 +1178,7 @@ class Contact extends CommonObject
* ref_commande (for order and/or shipments)
* ref_propale
*
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function load_ref_elements()
{
@ -1678,7 +1678,7 @@ class Contact extends CommonObject
* Change status of a user
*
* @param int $status Status to set
* @return int <0 if KO, 0 if nothing is done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing is done, >0 if OK
*/
public function setstatus($status)
{
@ -1758,7 +1758,7 @@ class Contact extends CommonObject
* Fetch roles (default contact of some companies) for the current contact.
* This load the array ->roles.
*
* @return int <0 if KO, Nb of roles found if OK
* @return int Return integer <0 if KO, Nb of roles found if OK
* @see updateRoles()
*/
public function fetchRoles()

View file

@ -462,7 +462,7 @@ if (empty($reshook)) {
$tva_tx = GETPOST('tva_tx', 'alpha');
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), 2) : 0);
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef), '', 2) : 0);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@ -766,10 +766,9 @@ if (empty($reshook)) {
// TODO Use object->updateline instead objedtline->update
$price_ht = price2num(GETPOST('elprice'), 'MU');
$remise_percent = price2num(GETPOST('elremise_percent'), 2);
$remise_percent = price2num(GETPOST('elremise_percent'), '', 2);
if ($remise_percent > 0) {
$remise = round(($price_ht * $remise_percent / 100), 2);
$price_ht = ($price_ht - $remise);
}
$objectline->fk_product = GETPOST('idprod', 'int');

View file

@ -680,7 +680,7 @@ class Contrat extends CommonObject
* @param string $ref_supplier Supplier ref
* @param int $noextrafields 0=Default to load extrafields, 1=No extrafields
* @param int $nolines 0=Default to load lines, 1=No lines
* @return int <0 if KO, 0 if not found or if two records found for same ref, Id of contract if OK
* @return int Return integer <0 if KO, 0 if not found or if two records found for same ref, Id of contract if OK
*/
public function fetch($id, $ref = '', $ref_customer = '', $ref_supplier = '', $noextrafields = 0, $nolines = 0)
{
@ -976,7 +976,7 @@ class Contrat extends CommonObject
* Create a contract into database
*
* @param User $user User that create
* @return int <0 if KO, id of contract if OK
* @return int Return integer <0 if KO, id of contract if OK
*/
public function create($user)
{
@ -1168,7 +1168,7 @@ class Contrat extends CommonObject
* Delete object
*
* @param User $user User that deletes
* @return int < 0 if KO, > 0 if OK
* @return int Return integer < 0 if KO, > 0 if OK
*/
public function delete($user)
{
@ -2282,7 +2282,7 @@ class Contrat extends CommonObject
*
* @param User $user Objet user
* @param string $mode "inactive" pour services a activer, "expired" pour services expires
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
* @return WorkboardResponse|int Return integer <0 if KO, WorkboardResponse if OK
*/
public function load_board($user, $mode)
{
@ -2378,7 +2378,7 @@ class Contrat extends CommonObject
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function load_state_board()
{
@ -2543,7 +2543,7 @@ class Contrat extends CommonObject
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @return int < 0 if KO, 0 = no doc generated, > 0 if OK
* @return int Return integer < 0 if KO, 0 = no doc generated, > 0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
{

View file

@ -160,9 +160,9 @@ class box_external_rss extends ModeleBoxes
$isutf8 = utf8_check($title);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
$title = utf8_encode($title);
$title = mb_convert_encoding($title, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
$title = utf8_decode($title);
$title = mb_convert_encoding($title, 'ISO-8859-1');
}
$title = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $title); // Gere probleme des apostrophes mal codee/decodee par utf8
@ -173,9 +173,9 @@ class box_external_rss extends ModeleBoxes
$description = !empty($item['description']) ? $item['description'] : '';
$isutf8 = utf8_check($description);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
$description = utf8_encode($description);
$description = mb_convert_encoding($description, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
$description = utf8_decode($description);
$description = mb_convert_encoding($description, 'ISO-8859-1');
}
$description = preg_replace("/([[:alnum:]])\?([[:alnum:]])/", "\\1'\\2", $description);
$description = preg_replace("/^\s+/", "", $description);

View file

@ -1242,7 +1242,7 @@ class CMailFile
* Read a file on disk and return encoded content for emails (mode = 'mail')
*
* @param string $sourcefile Path to file to encode
* @return int|string <0 if KO, encoded string if OK
* @return int|string Return integer <0 if KO, encoded string if OK
*/
private function _encode_file($sourcefile)
{
@ -1750,7 +1750,7 @@ class CMailFile
$_retVal = $socket;
}
} else {
$this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : utf8_encode('Error '.$errno.' - '.$errstr);
$this->error = utf8_check('Error '.$errno.' - '.$errstr) ? 'Error '.$errno.' - '.$errstr : mb_convert_encoding('Error '.$errno.' - '.$errstr, 'UTF-8', 'ISO-8859-1');
}
}
return $_retVal;

View file

@ -66,7 +66,7 @@ class AntiVir
* Return also true (virus found) if file end with '.virus' (so we can make test safely).
*
* @param string $file File to scan
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
* @return int Return integer <0 if KO (-98 if error, -99 if virus), 0 if OK
*/
public function dol_avscan_file($file)
{

View file

@ -237,7 +237,7 @@ class Comment extends CommonObject
*
* @param User $user User that modify
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
public function update(User $user, $notrigger = 0)
{

View file

@ -1232,7 +1232,7 @@ abstract class CommonDocGenerator
* @param float $curY curent Y position
* @param string $colKey the column key
* @param string $columnText column text
* @return int <0 if KO, >= if OK
* @return int Return integer <0 if KO, >= if OK
*/
public function printStdColumnContent($pdf, &$curY, $colKey, $columnText = '')
{
@ -1429,7 +1429,7 @@ abstract class CommonDocGenerator
$params = $params + $defaultParams;
/**
* @var $extrafields ExtraFields
* @var ExtraFields $extrafields
*/
$html = '';
@ -1658,7 +1658,7 @@ abstract class CommonDocGenerator
* @param object $object common object det
* @param Translate $outputlangs langs
* @param int $hidedetails Do not show line details
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function defineColumnExtrafield($object, $outputlangs, $hidedetails = 0)
{

View file

@ -280,7 +280,7 @@ abstract class CommonInvoice extends CommonObject
* of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended).
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float <0 and set ->error if KO, Sum of deposits amount otherwise
* @return float Return integer <0 and set ->error if KO, Sum of deposits amount otherwise
* @see getSommePaiement(), getSumCreditNotesUsed()
*/
public function getSumDepositsUsed($multicurrency = 0)
@ -313,7 +313,7 @@ abstract class CommonInvoice extends CommonObject
* Return amount (with tax) of all credit notes invoices + excess received used by invoice
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float <0 and set ->error if KO, Sum of credit notes and deposits amount otherwise
* @return float Return integer <0 and set ->error if KO, Sum of credit notes and deposits amount otherwise
* @see getSommePaiement(), getSumDepositsUsed()
*/
public function getSumCreditNotesUsed($multicurrency = 0)
@ -340,7 +340,7 @@ abstract class CommonInvoice extends CommonObject
* Return amount (with tax) of all converted amount for this credit note
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float <0 if KO, Sum of credit notes and deposits amount otherwise
* @return float Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumFromThisCreditNotesNotUsed($multicurrency = 0)
{
@ -388,7 +388,7 @@ abstract class CommonInvoice extends CommonObject
* Returns the id of the invoice that replaces it
*
* @param string $option status filter ('', 'validated', ...)
* @return int <0 si KO, 0 if no invoice replaces it, id of invoice otherwise
* @return int Return integer <0 si KO, 0 if no invoice replaces it, id of invoice otherwise
*/
public function getIdReplacingInvoice($option = '')
{
@ -534,7 +534,7 @@ abstract class CommonInvoice extends CommonObject
* If there is payment -> no (-4)
* Otherwise -> yes (2)
*
* @return int <=0 if no, >0 if yes
* @return int Return integer <=0 if no, >0 if yes
*/
public function is_erasable()
{
@ -595,7 +595,7 @@ abstract class CommonInvoice extends CommonObject
/**
* Return if an invoice was dispatched into bookkeeping
*
* @return int <0 if KO, 0=no, 1=yes
* @return int Return integer <0 if KO, 0=no, 1=yes
*/
public function getVentilExportCompta()
{
@ -954,7 +954,7 @@ abstract class CommonInvoice extends CommonObject
* @param string $type 'direct-debit' or 'bank-transfer'
* @param string $sourcetype Source ('facture' or 'supplier_invoice')
* @param int $checkduplicateamongall 0=Default (check among open requests only to find if request already exists). 1=Check also among requests completely processed and cancel if at least 1 request exists whatever is its status.
* @return int <0 if KO, 0 if a request already exists, >0 if OK
* @return int Return integer <0 if KO, 0 if a request already exists, >0 if OK
*/
public function demande_prelevement($fuser, $amount = 0, $type = 'direct-debit', $sourcetype = 'facture', $checkduplicateamongall = 0)
{
@ -1613,7 +1613,7 @@ abstract class CommonInvoice extends CommonObject
*
* @param User $fuser User making delete
* @param int $did ID of request to delete
* @return int <0 if OK, >0 if KO
* @return int Return integer <0 if OK, >0 if KO
*/
public function demande_prelevement_delete($fuser, $did)
{

View file

@ -769,7 +769,7 @@ abstract class CommonObject
* @param int $id Id of object
* @param string $ref Ref of object to check
* @param string $ref_ext Ref ext of object to check
* @return int <0 if KO, 0 if OK but not found, >0 if OK and exists
* @return int Return integer <0 if KO, 0 if OK but not found, >0 if OK and exists
*/
public static function isExistingObject($element, $id, $ref = '', $ref_ext = '')
{
@ -1091,7 +1091,7 @@ abstract class CommonObject
* @param int|string $type_contact Type of contact (code or id). Must be id or code found into table llx_c_type_contact. For example: SALESREPFOLL
* @param string $source external=Contact extern (llx_socpeople), internal=Contact intern (llx_user)
* @param int $notrigger Disable all triggers
* @return int <0 if KO, 0 if already added or code not valid, >0 if OK
* @return int Return integer <0 if KO, 0 if already added or code not valid, >0 if OK
*/
public function add_contact($fk_socpeople, $type_contact, $source = 'external', $notrigger = 0)
{
@ -1221,7 +1221,7 @@ abstract class CommonObject
* @param int $statut New status of link
* @param int $type_contact_id Id of contact type (not modified if 0)
* @param int $fk_socpeople Id of soc_people to update (not modified if 0)
* @return int <0 if KO, >= 0 if OK
* @return int Return integer <0 if KO, >= 0 if OK
*/
public function update_contact($rowid, $statut, $type_contact_id = 0, $fk_socpeople = 0)
{
@ -1301,7 +1301,7 @@ abstract class CommonObject
*
* @param string $source '' or 'internal' or 'external'
* @param string $code Type of contact (code or id)
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function delete_linked_contact($source = '', $code = '')
{
@ -1446,7 +1446,7 @@ abstract class CommonObject
* Update status of a contact linked to object
*
* @param int $rowid Id of link between object and contact
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function swapContactStatus($rowid)
{
@ -1804,7 +1804,7 @@ abstract class CommonObject
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
* if it is not defined, ->element must be defined to know default barcode type.
*
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
* @return int Return integer <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
*/
public function fetch_barcode()
{
@ -1851,7 +1851,7 @@ abstract class CommonObject
/**
* Load the project with id $this->fk_project into this->project
*
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_project()
{
@ -1863,7 +1863,7 @@ abstract class CommonObject
/**
* Load the project with id $this->fk_project into this->project
*
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_projet()
{
@ -1889,7 +1889,7 @@ abstract class CommonObject
/**
* Load the product with id $this->fk_product into this->product
*
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function fetch_product()
{
@ -2893,7 +2893,7 @@ abstract class CommonObject
* @deprecated
*
* @param int $id Address id
* @return int <0 si ko, >0 si ok
* @return int Return integer <0 si ko, >0 si ok
*/
public function setDeliveryAddress($id)
{
@ -3912,7 +3912,7 @@ abstract class CommonObject
* @param int $origin_id Linked element id
* @param User $f_user User that create
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @see fetchObjectLinked(), updateObjectLinked(), deleteObjectLinked()
*/
public function add_object_linked($origin = null, $origin_id = null, $f_user = null, $notrigger = 0)
@ -4474,7 +4474,7 @@ abstract class CommonObject
* @param int $fk_object_where id of object we need to remove linked items
* @param string $field_where name of field of object we need to delete linked items
* @param string $table_element name of association table
* @return int <0 if KO, 0 if nothing done, >0 if OK and something done
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK and something done
*/
public static function deleteAllItemsLinkedByObjectID($fk_object_where, $field_where, $table_element)
{
@ -4629,7 +4629,7 @@ abstract class CommonObject
*
* @param int $id Record id
* @param string $ref Record ref
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function getCanvas($id = 0, $ref = '')
{
@ -4696,7 +4696,7 @@ abstract class CommonObject
*
* @param int $id Force id of object
* @param int $entity Force entity to check
* @return int <0 if KO, 0 if not used, >0 if already used
* @return int Return integer <0 if KO, 0 if not used, >0 if already used
*/
public function isObjectUsed($id = 0, $entity = 0)
{
@ -4781,7 +4781,7 @@ abstract class CommonObject
* Function to say how many lines object contains
*
* @param int $predefined -1=All, 0=Count free product/service only, 1=Count predefined product/service only, 2=Count predefined product, 3=Count predefined service
* @return int <0 if KO, 0 if no predefined products, nb of lines with predefined products if found
* @return int Return integer <0 if KO, 0 if no predefined products, nb of lines with predefined products if found
*/
public function hasProductsOrServices($predefined = -1)
{
@ -5461,7 +5461,7 @@ abstract class CommonObject
* @param string $resource_type 'resource'
* @param int $busy Busy or not
* @param int $mandatory Mandatory or not
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
public function add_element_resource($resource_id, $resource_type, $busy = 0, $mandatory = 0)
{
@ -6017,7 +6017,7 @@ abstract class CommonObject
* Function to get alternative languages of a data into $this->array_languages
* This method is NOT called by method fetch of objects but must be called separately.
*
* @return int <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded
* @return int Return integer <0 if error, 0 if no values of alternative languages to find nor found, 1 if a value was found and loaded
* @see fetch_optionnals()
*/
public function fetchValuesForExtraLanguages()
@ -6195,7 +6195,7 @@ abstract class CommonObject
*
* @param int $rowid Id of line. Use the id of object if not defined. Deprecated. Function must be called without parameters.
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters.
* @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
* @return int Return integer <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded
* @see fetchValuesForExtraLanguages()
*/
public function fetch_optionals($rowid = null, $optionsArray = null)
@ -8926,7 +8926,7 @@ abstract class CommonObject
* @param float $unitPrice Product unit price
* @param float $discountPercent Line discount percent
* @param int $fk_product Product id
* @return float <0 if KO, buyprice if OK
* @return float Return integer <0 if KO, buyprice if OK
*/
public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
{
@ -9975,7 +9975,7 @@ abstract class CommonObject
* @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @param int $forcechilddeletion 0=no, 1=Force deletion of children
* @return int <0 if KO, 0=Nothing done because object has child, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done because object has child, >0 if OK
*/
public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0)
{
@ -10500,7 +10500,7 @@ abstract class CommonObject
* @param int $fromId Id object source
* @param int $toId Id object cible
* @param string $type Type of category ('product', ...)
* @return int < 0 if error, > 0 if ok
* @return int Return integer < 0 if error, > 0 if ok
*/
public function cloneCategories($fromId, $toId, $type = '')
{

View file

@ -154,7 +154,7 @@ abstract class CommonObjectLine extends CommonObject
* A langs->trans() must be called on result to get translated value.
*
* @param string $type Label type ('long', 'short' or 'code'). This can be a translation key.
* @return string|int <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE')
* @return string|int Return integer <0 if KO, label if OK (Example: 'long', 'short' or 'unitCODE')
*/
public function getLabelOfUnit($type = 'long')
{

View file

@ -235,7 +235,7 @@ class Conf extends stdClass
*
* @param DoliDB $db Database handler
* @param int $entity Entity to get
* @return int < 0 if KO, >= 0 if OK
* @return int Return integer < 0 if KO, >= 0 if OK
*/
public function setEntityValues($db, $entity)
{
@ -253,7 +253,7 @@ class Conf extends stdClass
* Note that this->db->xxx, this->file->xxx have been already set when setValues is called.
*
* @param DoliDB $db Database handler
* @return int < 0 if KO, >= 0 if OK
* @return int Return integer < 0 if KO, >= 0 if OK
*/
public function setValues($db)
{

View file

@ -294,7 +294,7 @@ class CProductNature extends CommonDict
* Get unit from code
* @param int $code code of unit
* @param string $mode 0= id , short_label=Use short label as value, code=use code
* @return int <0 if KO, Id of code if OK
* @return int Return integer <0 if KO, Id of code if OK
*/
public function getProductNatureFromCode($code, $mode = 'code')
{

View file

@ -402,7 +402,7 @@ class CUnits extends CommonDict
* @param string $code code of unit
* @param string $mode 0= id , short_label=Use short label as value, code=use code
* @param string $unit_type weight,size,surface,volume,qty,time...
* @return int <0 if KO, Id of code if OK
* @return int Return integer <0 if KO, Id of code if OK
*/
public function getUnitFromCode($code, $mode = 'code', $unit_type = '')
{

View file

@ -148,7 +148,7 @@ class DiscountAbsolute
* @param int $rowid id discount to load
* @param int $fk_facture_source fk_facture_source
* @param int $fk_invoice_supplier_source fk_invoice_supplier_source
* @return int <0 if KO, =0 if not found, >0 if OK
* @return int Return integer <0 if KO, =0 if not found, >0 if OK
*/
public function fetch($rowid, $fk_facture_source = 0, $fk_invoice_supplier_source = 0)
{
@ -530,7 +530,7 @@ class DiscountAbsolute
* @param int $maxvalue Filter on max value for discount
* @param int $discount_type 0 => customer discount, 1 => supplier discount
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, amount otherwise
* @return int Return integer <0 if KO, amount otherwise
*/
public function getAvailableDiscounts($company = '', $user = '', $filter = '', $maxvalue = 0, $discount_type = 0, $multicurrency = 0)
{
@ -584,7 +584,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice (customer of supplier)
* @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise
* @return int Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumDepositsUsed($invoice, $multicurrency = 0)
{
@ -625,7 +625,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice
* @param int $multicurrency 1=Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
* @return int <0 if KO, Sum of credit notes and excess received amount otherwise
* @return int Return integer <0 if KO, Sum of credit notes and excess received amount otherwise
*/
public function getSumCreditNotesUsed($invoice, $multicurrency = 0)
{
@ -665,7 +665,7 @@ class DiscountAbsolute
*
* @param CommonInvoice $invoice Object invoice
* @param int $multicurrency Return multicurrency_amount instead of amount. TODO Add a mode multicurrency = -1 to return array with amount + multicurrency amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise
* @return int Return integer <0 if KO, Sum of credit notes and deposits amount otherwise
*/
public function getSumFromThisCreditNotesNotUsed($invoice, $multicurrency = 0)
{

View file

@ -97,7 +97,7 @@ class EmailSenderProfile extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>-1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>1),
'email' => array('type'=>'varchar(255)', 'label'=>'Email', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1),
'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>-1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
'private' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'User', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'default'=>'0', 'notnull'=>1),
'signature' => array('type'=>'html', 'label'=>'Signature', 'visible'=>3, 'enabled'=>1, 'position'=>400, 'notnull'=>-1, 'index'=>1,),
'position' => array('type'=>'integer', 'label'=>'Position', 'visible'=>1, 'enabled'=>1, 'position'=>405, 'notnull'=>-1, 'index'=>1,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,),

View file

@ -135,7 +135,7 @@ class ExtraFields
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>Css on list, 'cssview'=>...)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
public function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique = 0, $required = 0, $default_value = '', $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
{
@ -197,7 +197,7 @@ class ExtraFields
* @param string $computed Computed value
* @param string $help Help on tooltip
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '', $help = '', $moreparams = array())
{
@ -300,7 +300,7 @@ class ExtraFields
* @param int $totalizable Is a measure. Must show a total on lists
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @throws Exception
*/
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
@ -433,7 +433,7 @@ class ExtraFields
*
* @param string $attrname Code of attribute to delete
* @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...)
* @return int < 0 if KO, 0 if nothing is done, 1 if OK
* @return int Return integer < 0 if KO, 0 if nothing is done, 1 if OK
*/
public function delete($attrname, $elementtype = 'member')
{
@ -491,7 +491,7 @@ class ExtraFields
*
* @param string $attrname Code of attribute to delete
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
* @return int < 0 if KO, 0 if nothing is done, 1 if OK
* @return int Return integer < 0 if KO, 0 if nothing is done, 1 if OK
*/
private function delete_label($attrname, $elementtype = 'member')
{
@ -673,7 +673,7 @@ class ExtraFields
* @param int $totalizable Is extrafield totalizable on list
* @param int $printable Is extrafield displayed on PDF
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @throws Exception
*/
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())

View file

@ -1730,7 +1730,7 @@ class Form
* @param bool $options_only Return options only (for ajax treatment)
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param string $htmlid Html id to use instead of htmlname
* @return int <0 if KO, Nb of contact in list if OK
* @return int Return integer <0 if KO, Nb of contact in list if OK
* @deprecated You can use selectcontacts directly (warning order of param was changed)
*/
public function select_contacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $showsoc = 0, $forcecombo = 0, $events = array(), $options_only = false, $moreparam = '', $htmlid = '')
@ -1762,7 +1762,7 @@ class Form
* @param string $htmlid Html id to use instead of htmlname
* @param bool $multiple add [] in the name of element and add 'multiple' attribut
* @param integer $disableifempty Set tag 'disabled' on select if there is no choice
* @return int|string <0 if KO, HTML with select string if OK.
* @return int|string Return integer <0 if KO, HTML with select string if OK.
*/
public function selectcontacts($socid, $selected = '', $htmlname = 'contactid', $showempty = 0, $exclude = '', $limitto = '', $showfunction = 0, $morecss = '', $options_only = false, $showsoc = 0, $forcecombo = 0, $events = array(), $moreparam = '', $htmlid = '', $multiple = false, $disableifempty = 0)
{
@ -4880,7 +4880,7 @@ class Form
* @param int $showcurrency Show currency in label
* @param string $morecss More CSS
* @param int $nooutput 1=Return string, do not send to output
* @return int <0 if error, Num of bank account found if OK (0, 1, 2, ...)
* @return int Return integer <0 if error, Num of bank account found if OK (0, 1, 2, ...)
*/
public function select_comptes($selected = '', $htmlname = 'accountid', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '', $showcurrency = 0, $morecss = '', $nooutput = 0)
{
@ -4963,7 +4963,7 @@ class Form
* @param string $filtre To filter list. This parameter must not come from input of users
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
* @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...)
* @return int Return integer <0 if error, Num of establishment found if OK (0, 1, 2, ...)
*/
public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '')
{
@ -8995,7 +8995,7 @@ class Form
* @param string $morehtmlright More html to show on right of title
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
* @param string $title Title
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title = 'RelatedObjects')
{

View file

@ -167,7 +167,7 @@ class FormActions
* @param string $moreparambacktopage More param for the backtopage
* @param string $morehtmlcenter More html text on center of title line
* @param int $assignedtouser Assign event by default to this user id (will be ignored if not enough permissions)
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function showactions($object, $typeelement, $socid = 0, $forceshowtitle = 0, $morecss = 'listactions', $max = 0, $moreparambacktopage = '', $morehtmlcenter = '', $assignedtouser = 0)
{

View file

@ -1155,7 +1155,7 @@ class FormCompany extends Form
* @param string $mode select if we want activate de html part or js
* @return void
*/
public function selectProspectStatus($htmlname, Societe $prospectstatic, $statusprospect, $idprospect, $mode = "html")
public function selectProspectStatus($htmlname, $prospectstatic, $statusprospect, $idprospect, $mode = "html")
{
global $langs;

View file

@ -296,7 +296,7 @@ class FormFile
* @param string $title Title to show on top of form
* @param string $buttonlabel Label on submit button
* @param string $codelang Default language code to use on lang combo box if multilang is enabled
* @return int <0 if KO, number of shown files if OK
* @return int Return integer <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead.
*/
public function show_documents($modulepart, $modulesubdir, $filedir, $urlsource, $genallowed, $delallowed = 0, $modelselected = '', $allowgenifempty = 1, $forcenomultilang = 0, $iconPDF = 0, $notused = 0, $noform = 0, $param = '', $title = '', $buttonlabel = '', $codelang = '')
@ -1185,7 +1185,7 @@ class FormFile
* @param int $addfilterfields Add the line with filters
* @param int $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitely to 0 or 1)
* @param string $moreattrondiv More attributes on the div for responsive. Example 'style="height:280px; overflow: auto;"'
* @return int <0 if KO, nb of files shown if OK
* @return int Return integer <0 if KO, nb of files shown if OK
* @see list_of_autoecmfiles()
*/
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '')
@ -1643,7 +1643,7 @@ class FormFile
* @param int $maxlength Maximum length of file name shown
* @param string $url Full url to use for click links ('' = autodetect)
* @param int $addfilterfields Add line with filters
* @return int <0 if KO, nb of files shown if OK
* @return int Return integer <0 if KO, nb of files shown if OK
* @see list_of_documents()
*/
public function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload = 0, $relativepath = '', $permissiontodelete = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $url = '', $addfilterfields = 0)

View file

@ -1521,7 +1521,7 @@ class FormMail extends Form
* @param string $type_template Get message for key module
* @param User $user Use template public or limited to this user
* @param Translate $outputlangs Output lang object
* @return int <0 if KO,
* @return int Return integer <0 if KO,
*/
public function isEMailTemplate($type_template, $user, $outputlangs)
{
@ -1555,7 +1555,7 @@ class FormMail extends Form
* @param User $user Use template public or limited to this user
* @param Translate $outputlangs Output lang object
* @param int $active 1=Only active template, 0=Only disabled, -1=All
* @return int <0 if KO, nb of records found if OK
* @return int Return integer <0 if KO, nb of records found if OK
*/
public function fetchAllEMailTemplate($type_template, $user, $outputlangs, $active = 1)
{

View file

@ -219,7 +219,7 @@ class InfoBox
* @param int $zone Name of area (0 for Homepage, ...)
* @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...'
* @param int $userid Id of user
* @return int <0 if KO, 0=Nothing done, > 0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK
*/
public static function saveboxorder($dbs, $zone, $boxorder, $userid = 0)
{

View file

@ -260,7 +260,7 @@ class Ldap
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
* After return, this->connection and $this->bind are defined
*
* @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
* @return int Return integer <0 if KO, 1 if bind anonymous, 2 if bind auth
*/
public function connect_bind()
{
@ -1007,7 +1007,7 @@ class Ldap
*
* @param string $dn DN entry key
* @param string $filter Filter
* @return int|array <0 or false if KO, array if OK
* @return int|array Return integer <0 or false if KO, array if OK
*/
public function getAttribute($dn, $filter)
{
@ -1511,10 +1511,10 @@ class Ldap
{
global $conf;
if ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') {
$str = utf8_encode($str);
$str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
if ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') {
$str = utf8_decode($str);
$str = mb_convert_encoding($str, 'ISO-8859-1');
}
return $str;
}
@ -1530,10 +1530,10 @@ class Ldap
{
global $conf;
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') {
$str = utf8_decode($str);
$str = mb_convert_encoding($str, 'ISO-8859-1');
}
if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') {
$str = utf8_encode($str);
$str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
return $str;
}

View file

@ -1,6 +1,7 @@
<?php
/**
* lessphp v0.5.0
* lessphp v0.8.0
* http://leafo.net/lessphp
*
* LESS CSS compiler, adapted from http://lesscss.org
@ -38,7 +39,8 @@
*/
class Lessc
{
public static $VERSION = "v0.5.0";
public static $VERSION = "v0.8.0";
public static $TRUE = array("keyword", "true");
public static $FALSE = array("keyword", "false");
@ -89,8 +91,8 @@ class Lessc
/**
* fileExists
*
* @param string $name Filename
* @return boolean
* @param string $name Filename
* @return boolean
*/
protected function fileExists($name)
{
@ -213,7 +215,7 @@ class Lessc
* Compiling the block involves pushing a fresh environment on the stack,
* and iterating through the props, compiling each one.
*
* See lessc::compileProp()
* See Lessc::compileProp()
*
*/
protected function compileBlock($block)
@ -404,7 +406,7 @@ class Lessc
case "mediaExp":
if (isset($q[2])) {
$parts[] = "($q[1]: ".
$this->compileValue($this->reduce($q[2])).")";
$this->compileValue($this->reduce($q[2])).")";
} else {
$parts[] = "($q[1])";
}
@ -432,7 +434,7 @@ class Lessc
{
if (is_null($env) ||
!empty($env->block->type) && $env->block->type != "media"
) {
) {
return $childQueries;
}
@ -714,7 +716,7 @@ class Lessc
$value = $a[2];
} else {
$value = null; // :(
$this->throwError("Failed to assign arg ".$a[1]); // This end function by throwing an exception
$this->throwError("Failed to assign arg ".$a[1]); // This ends function by throwing an exception
}
$value = $this->reduce($value);
@ -728,7 +730,7 @@ class Lessc
// check for a rest
$last = end($args);
if ($last[0] == "rest") {
if ($last && $last[0] == "rest") {
$rest = array_slice($orderedValues, count($args) - 1);
$this->set($last[1], $this->reduce(array("list", " ", $rest)));
}
@ -765,6 +767,7 @@ class Lessc
$orderedArgs = array();
$keywordArgs = array();
foreach ((array) $args as $arg) {
$argval = null;
switch ($arg[0]) {
case "arg":
if (!isset($arg[2])) {
@ -817,11 +820,11 @@ class Lessc
$subProp[0] == "assign" &&
is_string($subProp[1]) &&
$subProp[1][0] != $this->vPrefix
) {
) {
$subProp[2] = array(
'list', ' ',
array($subProp[2], array('keyword', $suffix))
);
'list', ' ',
array($subProp[2], array('keyword', $suffix))
);
}
$this->compileProp($subProp, $mixin, $out);
@ -859,7 +862,7 @@ class Lessc
$result = $this->tryImport($importPath, $block, $out);
$this->env->imports[$importId] = $result === false ?
array(false, "@import ".$this->compileValue($importPath).";") : $result;
array(false, "@import ".$this->compileValue($importPath).";") : $result;
break;
case "import_mixin":
@ -876,7 +879,7 @@ class Lessc
break;
default:
$this->throwError("unknown op: $prop[0]\n");
$this->throwError("unknown op: {$prop[0]}\n");
}
}
@ -1128,7 +1131,7 @@ class Lessc
if (isset($items[0])) {
return $this->lib_e($items[0]);
}
$this->throwError("unrecognised input"); // This end function by throwing an exception
$this->throwError("unrecognised input"); // This ends function by throwing an exception
// no break
case "string":
$arg[1] = "";
@ -1154,7 +1157,7 @@ class Lessc
if (preg_match_all('/%[dsa]/', $template, $m)) {
foreach ($m[0] as $match) {
$val = isset($values[$i]) ?
$this->reduce($values[$i]) : array('keyword', '');
$this->reduce($values[$i]) : array('keyword', '');
// lessjs compat, renders fully expanded color, not raw color
if ($color = $this->coerceColor($val)) {
@ -1387,7 +1390,7 @@ class Lessc
* mix(@color1, @color2, [@weight: 50%]);
* http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method
*
* @param array $args Args
* @param array $args Args
* @return array
*/
protected function lib_mix($args)
@ -1431,7 +1434,7 @@ class Lessc
/**
* lib_contrast
*
* @param array $args Args
* @param array $args Args
* @return array
*/
protected function lib_contrast($args)
@ -1520,7 +1523,7 @@ class Lessc
$name = $name.": ";
}
$this->throwError("${name}expecting $expectedArgs arguments, got $numValues");
$this->throwError("{$name}expecting $expectedArgs arguments, got $numValues");
}
return $values;
@ -1610,7 +1613,7 @@ class Lessc
$r = $g = $b = $L;
} else {
$temp2 = $L < 0.5 ?
$L * (1.0 + $S) : $L + $S - $L * $S;
$L * (1.0 + $S) : $L + $S - $L * $S;
$temp1 = 2.0 * $L - $temp2;
@ -1669,6 +1672,7 @@ class Lessc
$hsl[] = 0;
}
return $this->toRGB($hsl);
} elseif ($fname == 'rgb' || $fname == 'rgba') {
$components = array();
$i = 1;
@ -1769,7 +1773,7 @@ class Lessc
}
$f = isset($this->libFunctions[$name]) ?
$this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name));
$this->libFunctions[$name] : array($this, 'lib_'.str_replace('-', '_', $name));
if (is_callable($f)) {
if ($args[0] == 'list') {
@ -1842,10 +1846,10 @@ class Lessc
$width = strlen($colorStr) == 3 ? 16 : 256;
for ($i = 3; $i > 0; $i--) { // 3 2 1
$t = $num % $width;
$t = intval($num) % $width;
$num /= $width;
$c[$i] = $t * (256 / $width) + $t * floor(16 / $width);
$c[$i] = $t * (256 / $width) + $t * floor(16/$width);
}
return $c;
@ -1923,7 +1927,7 @@ class Lessc
}
// type based operators
$fname = "op_".$ltype."_".$rtype;
$fname = "op_{$ltype}_{$rtype}";
if (is_callable(array($this, $fname))) {
$out = $this->$fname($op, $left, $right);
if (!is_null($out)) {
@ -1957,7 +1961,6 @@ class Lessc
array_unshift($strRight[2], $left);
return $strRight;
}
return '';
}
@ -1982,7 +1985,6 @@ class Lessc
if ($op == '+' || $op == '*') {
return $this->op_color_number($op, $rgt, $lft);
}
return array();
}
@ -2160,7 +2162,7 @@ class Lessc
}
$current = isset($current->storeParent) ?
$current->storeParent : $current->parent;
$current->storeParent : $current->parent;
}
$this->throwError("variable $name is undefined");
@ -2638,7 +2640,7 @@ class lessc_parser
// these properties will supress division unless it's inside parenthases
protected static $supressDivisionProps =
array('/border-radius$/i', '/^font$/i');
array('/border-radius$/i', '/^font$/i');
protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport");
protected $lineDirectives = array("charset");
@ -2682,10 +2684,10 @@ class lessc_parser
if (!self::$operatorString) {
self::$operatorString =
'('.implode('|', array_map(
array('lessc', 'preg_quote'),
array_keys(self::$precedence)
)).')';
'('.implode('|', array_map(
array('lessc', 'preg_quote'),
array_keys(self::$precedence)
)).')';
$commentSingle = Lessc::preg_quote(self::$commentSingle);
$commentMultiLeft = Lessc::preg_quote(self::$commentMultiLeft);
@ -2699,7 +2701,7 @@ class lessc_parser
/**
* Parse a string
*
* @param string $buffer String to parse
* @param string $buffer String to parse
* @throws exception
* @return NULL|stdclass
*/
@ -2726,6 +2728,7 @@ class lessc_parser
if ($this->count != strlen($this->buffer)) {
$this->throwError('parse error count '.$this->count.' != len buffer '.strlen($this->buffer));
}
// TODO report where the block was opened
@ -2748,7 +2751,7 @@ class lessc_parser
* functions represent discrete grammatical rules for the language, and
* they are able to capture the text that represents those rules.
*
* Consider the function lessc::keyword(). (all parse functions are
* Consider the function Lessc::keyword(). (all parse functions are
* structured the same)
*
* The function takes a single reference argument. When calling the
@ -2757,7 +2760,7 @@ class lessc_parser
* argument, advance the position in the buffer, and return true. If it
* fails then it won't advance the buffer and it will return false.
*
* All of these parse functions are powered by lessc::match(), which behaves
* All of these parse functions are powered by Lessc::match(), which behaves
* the same way, but takes a literal regular expression. Sometimes it is
* more convenient to use match instead of creating a new function.
*
@ -2766,7 +2769,7 @@ class lessc_parser
*
* But, if some of the rules in the chain succeed before one fails, then
* the buffer position will be left at an invalid state. In order to
* avoid this, lessc::seek() is used to remember and set buffer positions.
* avoid this, Lessc::seek() is used to remember and set buffer positions.
*
* Before parsing a chain, use $s = $this->seek() to remember the current
* position into $s. Then if a chain fails, use $this->seek($s) to
@ -2801,7 +2804,7 @@ class lessc_parser
// setting a property
if ($this->keyword($key) && $this->assign() &&
$this->propertyValue($value, $key) && $this->end()
) {
) {
$this->append(array('assign', $key, $value), $s);
return true;
} else {
@ -2817,7 +2820,7 @@ class lessc_parser
if ($this->literal('@media')) {
if ($this->mediaQueryList($mediaQueries)
&& $this->literal('{')
) {
) {
$media = $this->pushSpecialBlock("media");
$media->queries = is_null($mediaQueries) ? array() : $mediaQueries;
return true;
@ -2831,7 +2834,7 @@ class lessc_parser
if ($this->isDirective($dirName, $this->blockDirectives)) {
if ($this->openString("{", $dirValue, null, array(";")) &&
$this->literal("{")
) {
) {
$dir = $this->pushSpecialBlock("directive");
$dir->name = $dirName;
if (isset($dirValue)) {
@ -2852,8 +2855,8 @@ class lessc_parser
// setting a variable
if ($this->variable($var) && $this->assign() &&
$this->propertyValue($value) && $this->end()
) {
$this->propertyValue($value) && $this->end()
) {
$this->append(array('assign', $var, $value), $s);
return true;
} else {
@ -2867,9 +2870,9 @@ class lessc_parser
// opening parametric mixin
if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) &&
$this->guards($guards) &&
$this->literal('{')
) {
$this->guards($guards) &&
$this->literal('{')
) {
$block = $this->pushBlock($this->fixTags(array($tag)));
$block->args = $args;
$block->isVararg = $isVararg;
@ -2930,9 +2933,9 @@ class lessc_parser
// mixin
if ($this->mixinTags($tags) &&
$this->argumentDef($argv, $isVararg) &&
$this->keyword($suffix) && $this->end()
) {
$this->argumentDef($argv, $isVararg) &&
$this->keyword($suffix) && $this->end()
) {
$tags = $this->fixTags($tags);
$this->append(array('mixin', $tags, $argv, $suffix), $s);
return true;
@ -3032,7 +3035,7 @@ class lessc_parser
while (true) {
$whiteBefore = isset($this->buffer[$this->count - 1]) &&
ctype_space($this->buffer[$this->count - 1]);
ctype_space($this->buffer[$this->count - 1]);
// If there is whitespace before the operator, then we require
// whitespace after the operator for it to be an expression
@ -3051,7 +3054,7 @@ class lessc_parser
$whiteAfter = isset($this->buffer[$this->count - 1]) &&
ctype_space($this->buffer[$this->count - 1]);
ctype_space($this->buffer[$this->count - 1]);
if (!$this->value($rhs)) {
break;
@ -3126,7 +3129,7 @@ class lessc_parser
if ($this->literal("(") &&
($this->inParens = true) && $this->expression($exp) &&
$this->literal(")")
) {
) {
$out = $exp;
$this->inParens = $inParens;
return true;
@ -3153,9 +3156,9 @@ class lessc_parser
// negation
if ($this->literal("-", false) &&
(($this->variable($inner) && $inner = array("variable", $inner)) ||
$this->unit($inner) ||
$this->parenValue($inner))
) {
$this->unit($inner) ||
$this->parenValue($inner))
) {
$value = array("unary", "-", $inner);
return true;
} else {
@ -3293,7 +3296,7 @@ class lessc_parser
$this->keyword($feature) &&
($this->literal(":") && $this->expression($value)) &&
$this->literal(")")
) {
) {
$out = array("mediaExp", $feature);
if ($value) {
$out[] = $value;
@ -3449,7 +3452,7 @@ class lessc_parser
if ($this->literal("@{") &&
$this->openString("}", $interp, null, array("'", '"', ";")) &&
$this->literal("}", false)
) {
) {
$out = array("interpolate", $interp);
$this->eatWhiteDefault = $oldWhite;
if ($this->eatWhiteDefault) {
@ -3586,6 +3589,7 @@ class lessc_parser
$newArg = array("lit", $newList);
break;
}
} elseif ($values) { // 1 item
$newArg = $values[0];
}
@ -3745,7 +3749,7 @@ class lessc_parser
$this->eatWhiteDefault = false;
while (true) {
$m =array();
$m = array();
if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) {
$parts[] = $m[1];
if ($simple) {
@ -3855,7 +3859,7 @@ class lessc_parser
$s = $this->seek();
if ($this->literal($this->lessc->vPrefix, false) &&
($this->variable($sub) || $this->keyword($name))
) {
) {
if (!empty($sub)) {
$name = array('variable', $sub);
} else {
@ -3991,7 +3995,7 @@ class lessc_parser
$this->count++;
return true;
}
// goes below...
// goes below...
} else {
return false;
}
@ -4064,7 +4068,7 @@ class lessc_parser
}
$r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais';
if (preg_match($r, $this->buffer, $out, null, $this->count)) {
if (preg_match($r, $this->buffer, $out, 0, $this->count)) {
$this->count += strlen($out[0]);
if ($eatWhitespace && $this->writeComments) {
$this->whitespace();
@ -4080,7 +4084,7 @@ class lessc_parser
if ($this->writeComments) {
$gotWhite = false;
$m = array();
while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) {
while (preg_match(self::$whitePattern, $this->buffer, $m, 0, $this->count)) {
if (isset($m[1]) && empty($this->seenComments[$this->count])) {
$this->append(array("comment", $m[1]));
$this->seenComments[$this->count] = true;
@ -4102,7 +4106,7 @@ class lessc_parser
$from = $this->count;
}
$r = '/'.$regex.'/Ais';
$result = preg_match($r, $this->buffer, $out, null, $from);
$result = preg_match($r, $this->buffer, $out, 0, $from);
return $result;
}
@ -4125,7 +4129,7 @@ class lessc_parser
$count = is_null($count) ? $this->count : $count;
$line = $this->line +
substr_count(substr($this->buffer, 0, $count), "\n");
substr_count(substr($this->buffer, 0, $count), "\n");
if (!empty($this->sourceName)) {
$loc = "$this->sourceName on line $line";
@ -4220,6 +4224,7 @@ class lessc_parser
break;
case '"':
case "'":
$m = array();
if (preg_match('/'.$min[0].'.*?(?<!\\\\)'.$min[0].'/', $text, $m, 0, $count)) {
$count += strlen($m[0]) - 1;
}
@ -4312,7 +4317,7 @@ class lessc_formatter_classic
$inner = $pre = $this->indentStr();
$isSingle = !$this->disableSingle &&
is_null($block->type) && count($block->lines) == 1;
is_null($block->type) && count($block->lines) == 1;
if (!empty($block->selectors)) {
$this->indentLevel++;
@ -4324,7 +4329,7 @@ class lessc_formatter_classic
}
echo $pre.
implode($selectorSeparator, $block->selectors);
implode($selectorSeparator, $block->selectors);
if ($isSingle) {
echo $this->openSingle;
$inner = "";
@ -4363,7 +4368,7 @@ class lessc_formatter_classic
}
/**
* Class for compressed result
* Class for compressed result
*/
class lessc_formatter_compressed extends lessc_formatter_classic
{
@ -4381,7 +4386,7 @@ class lessc_formatter_compressed extends lessc_formatter_classic
}
/**
* Class for lessjs
* Class for lessjs
*/
class lessc_formatter_lessjs extends lessc_formatter_classic
{

View file

@ -147,7 +147,7 @@ class Link extends CommonObject
*
* @param User $user User executing update
* @param int $call_trigger 0=no, 1=yes
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function update($user = '', $call_trigger = 1)
{
@ -346,7 +346,7 @@ class Link extends CommonObject
* Delete a link from database
*
* @param User $user Object suer
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
public function delete($user)
{

View file

@ -179,7 +179,7 @@ class Menubase
* Create menu entry into database
*
* @param User $user User that create
* @return int <0 if KO, Id of record if OK
* @return int Return integer <0 if KO, Id of record if OK
*/
public function create($user = null)
{

View file

@ -188,7 +188,7 @@ class Notify
* @param Object $object Object the notification is about (need it to check threshold value of some notifications)
* @param int $userid Id of user or 0 for all users or -1 for no users
* @param array $scope Scope where to search
* @return array|int <0 if KO, array of notifications to send if OK
* @return array|int Return integer <0 if KO, array of notifications to send if OK
*/
public function getNotificationsArray($notifcode, $socid = 0, $object = null, $userid = 0, $scope = array('thirdparty', 'user', 'global'))
{
@ -352,7 +352,7 @@ class Notify
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
* @return int <0 if KO, or number of changes if OK
* @return int Return integer <0 if KO, or number of changes if OK
*/
public function send($notifcode, $object, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array())
{

View file

@ -448,7 +448,7 @@ class TimeSpent extends CommonObject
*
* @param User $user User making status change
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <=0 if OK, 0=Nothing done, >0 if KO
* @return int Return integer <=0 if OK, 0=Nothing done, >0 if KO
*/
public function validate($user, $notrigger = 0)
{
@ -605,7 +605,7 @@ class TimeSpent extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function cancel($user, $notrigger = 0)
{
@ -629,7 +629,7 @@ class TimeSpent extends CommonObject
*
* @param User $user Object user that modify
* @param int $notrigger 1=Does not execute triggers, 0=Execute triggers
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
*/
public function reopen($user, $notrigger = 0)
{

View file

@ -166,7 +166,7 @@ class Translate
* Load translation files.
*
* @param array $domains Array of lang files to load
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadLangs($domains)
{
@ -200,7 +200,7 @@ class Translate
* @param int $forcelangdir To force a different lang directory
* @param int $loadfromfileonly 1=Do not load overwritten translation from file or old conf.
* @param int $forceloadifalreadynotfound Force attempt to reload lang file if it was previously not found
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @see loadLangs()
*/
public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir = '', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0)
@ -432,7 +432,7 @@ class Translate
* Value for hash are: 1:Loaded from disk, 2:Not found, 3:Loaded from cache
*
* @param DoliDB $db Database handler
* @return int <0 if KO, 0 if already loaded or loading not required, >0 if OK
* @return int Return integer <0 if KO, 0 if already loaded or loading not required, >0 if OK
*/
public function loadFromDatabase($db)
{
@ -803,10 +803,10 @@ class Translate
public function convToOutputCharset($str, $pagecodefrom = 'UTF-8')
{
if ($pagecodefrom == 'ISO-8859-1' && $this->charset_output == 'UTF-8') {
$str = utf8_encode($str);
$str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1');
}
if ($pagecodefrom == 'UTF-8' && $this->charset_output == 'ISO-8859-1') {
$str = utf8_decode(str_replace('€', chr(128), $str));
$str = mb_convert_encoding(str_replace('€', chr(128), $str), 'ISO-8859-1');
// TODO Replace with iconv("UTF-8", "ISO-8859-1", str_replace('€', chr(128), $str)); ?
}
return $str;

View file

@ -332,7 +332,7 @@ interface Database
* @param array $unique_keys Associative array Name of fields that will be unique key => value
* @param array $fulltext_keys Field name table that will be indexed in fulltext
* @param array $keys Table of key fields names => value
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
// phpcs:enable
@ -342,7 +342,7 @@ interface Database
* Drop a table into database
*
* @param string $table Name of table
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table);
// phpcs:enable
@ -430,7 +430,7 @@ interface Database
* @param string $dolibarr_main_db_user Username to create
* @param string $dolibarr_main_db_pass User password to create
* @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser(
$dolibarr_main_db_host,

View file

@ -802,7 +802,7 @@ class DoliDBMysqli extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@ -883,7 +883,7 @@ class DoliDBMysqli extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@ -1040,7 +1040,7 @@ class DoliDBMysqli extends DoliDB
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{

View file

@ -1062,7 +1062,7 @@ class DoliDBPgsql extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@ -1136,7 +1136,7 @@ class DoliDBPgsql extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@ -1160,7 +1160,7 @@ class DoliDBPgsql extends DoliDB
* @param string $dolibarr_main_db_user Name of user to create
* @param string $dolibarr_main_db_pass Password of user to create
* @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{

View file

@ -964,7 +964,7 @@ class DoliDBSqlite3 extends DoliDB
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null)
{
@ -1037,7 +1037,7 @@ class DoliDBSqlite3 extends DoliDB
* Drop a table into database
*
* @param string $table Name of table
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLDropTable($table)
{
@ -1173,7 +1173,7 @@ class DoliDBSqlite3 extends DoliDB
* @param string $dolibarr_main_db_user Nom user a creer
* @param string $dolibarr_main_db_pass Mot de passe user a creer
* @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK
* @return int Return integer <0 if KO, >=0 if OK
*/
public function DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name)
{

View file

@ -926,7 +926,7 @@ function ConvertToXmlAttribute($value)
}
if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) {
return (utf8_encode(htmlspecialchars($value)));
return (mb_convert_encoding(htmlspecialchars($value), 'UTF-8', 'ISO-8859-1'));
} else {
return (htmlspecialchars($value));
}

View file

@ -164,7 +164,7 @@ function versiondolibarrarray()
* @param int $colspan 2=Add a colspan=2 on td
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template are allowed
* @param string $database Database (replace __DATABASE__ with this value)
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
*/
function run_sql($sqlfile, $silent = 1, $entity = 0, $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0, $database = '')
{

View file

@ -113,7 +113,7 @@ function dol_dir_list($path, $types = "all", $recursive = 0, $filter = "", $excl
$fileperm = '';
while (false !== ($file = readdir($dir))) { // $file is always a basename (into directory $newpath)
if (!utf8_check($file)) {
$file = utf8_encode($file); // To be sure data is stored in utf8 in memory
$file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in utf8 in memory
}
$fullpathfile = ($newpath ? $newpath.'/' : '').$file;
@ -550,7 +550,7 @@ function dol_dir_is_emtpy($folder)
* Count number of lines in a file
*
* @param string $file Filename
* @return int <0 if KO, Number of lines in files if OK
* @return int Return integer <0 if KO, Number of lines in files if OK
* @see dol_nboflines()
*/
function dol_count_nb_of_line($file)
@ -623,7 +623,7 @@ function dol_fileperm($pathoffile)
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
* @param int $indexdatabase 1=index new file into database.
* @param int $arrayreplacementisregex 1=Array of replacement is regex
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dol_copy()
*/
function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask = 0, $indexdatabase = 0, $arrayreplacementisregex = 0)
@ -711,7 +711,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile = '', $newmask
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param int $testvirus Do an antivirus test. Move is canceled if a virus is found.
* @param int $indexdatabase Index new file into database.
* @return int <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (dest file already exists and overwriteifexists=0), >0 if OK
* @see dol_delete_file() dolCopyDir()
*/
function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $testvirus = 0, $indexdatabase = 0)
@ -839,7 +839,7 @@ function dol_copy($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
* @param array $arrayreplacement Array to use to replace filenames with another one during the copy (works only on file names, not on directory names).
* @param int $excludesubdir 0=Do not exclude subdirectories, 1=Exclude subdirectories, 2=Exclude subdirectories if name is not a 2 chars (used for country codes subdirectories).
* @param array $excludefileext Exclude some file extensions
* @return int <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @return int Return integer <0 if error, 0 if nothing done (all files already exists and overwriteifexists=0), >0 if OK
* @see dol_copy()
*/
function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayreplacement = null, $excludesubdir = 0, $excludefileext = null)
@ -1515,7 +1515,7 @@ function dol_delete_dir_recursive($dir, $count = 0, $nophperrors = 0, $onlysub =
if ($handle = opendir("$dir_osencoded")) {
while (false !== ($item = readdir($handle))) {
if (!utf8_check($item)) {
$item = utf8_encode($item); // should be useless
$item = mb_convert_encoding($item, 'UTF-8', 'ISO-8859-1'); // should be useless
}
if ($item != "." && $item != "..") {
@ -1755,7 +1755,7 @@ function dol_init_file_process($pathtoscan = '', $trackid = '')
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
* @param int $generatethumbs 1=Generate also thumbs for uploaded image files
* @param Object $object Object used to set 'src_object_*' fields
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @see dol_remove_file_process()
*/
function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesession = 0, $varfiles = 'addedfile', $savingdocmask = '', $link = null, $trackid = '', $generatethumbs = 1, $object = null)
@ -1991,7 +1991,7 @@ function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletef
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @param int $setsharekey Set also the share key
* @param Object $object Object used to set 'src_object_*' fields
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uploaded', $setsharekey = 0, $object = null)
{
@ -2056,7 +2056,7 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo
* @param string $dir Directory name (full real path without ending /)
* @param string $file File name
* @param string $mode How file was created ('uploaded', 'generated', ...)
* @return int <0 if KO, 0 if nothing done, >0 if OK
* @return int Return integer <0 if KO, 0 if nothing done, >0 if OK
*/
function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
{
@ -2114,7 +2114,7 @@ function deleteFilesIntoDatabaseIndex($dir, $file, $mode = 'uploaded')
* @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided).
* @param string $fileoutput Output filename
* @param string $page Page number if we convert a PDF into png
* @return int <0 if KO, 0=Nothing done, >0 if OK
* @return int Return integer <0 if KO, 0=Nothing done, >0 if OK
* @see dol_imageResizeOrCrop()
*/
function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '')

View file

@ -630,7 +630,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
return 'BadFirstParameterForGETPOST';
}
if (empty($check)) {
dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and a 2nd param that is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
// Enable this line to know who call the GETPOST with '' $check parameter.
//var_dump(debug_backtrace()[0]);
}
@ -659,7 +659,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
//var_dump($user->default_values);
// Code for search criteria persistence.
// Retrieve values if restore_lastsearch_values
// Retrieve saved values if restore_lastsearch_values is set
if (!empty($_GET['restore_lastsearch_values'])) { // Use $_GET here and not GETPOST
if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
$tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true);
@ -815,7 +815,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
}
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable parameters)
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value, when using variable parameters __XXX__ in the GET URL)
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOMPANY_COUNTRY_ID__, __USER_ID__, ...
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
@ -873,7 +873,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
}
}
// Check rule
// Check type of variable and make sanitization according to this
if (preg_match('/^array/', $check)) { // If 'array' or 'array:restricthtml' or 'array:aZ09' or 'array:intcomma'
if (!is_array($out) || empty($out)) {
$out = array();
@ -1075,6 +1075,9 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
$out = filter_var($out, $filter, $options);
}
break;
default:
dol_syslog("Error, you call sanitizeVal() with a bad value for the check type. Data can't be sanitized.", LOG_ERR);
break;
}
return $out;
@ -6753,7 +6756,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
* @param int $idprod Id of product
* @param int $local 1 for localtax1, 2 for localtax 2
* @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...)
* @return int <0 if KO, Vat rate if OK
* @return int Return integer <0 if KO, Vat rate if OK
* @see get_product_vat_for_country()
*/
function get_product_localtax_for_country($idprod, $local, $thirdpartytouse)
@ -7138,7 +7141,7 @@ function get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart = '
* @param string $dir Directory to create (Separator must be '/'. Example: '/mydir/mysubdir')
* @param string $dataroot Data root directory (To avoid having the data root in the loop. Using this will also lost the warning, on first dir, saying PHP has no permission when open_basedir is used)
* @param string $newmask Mask for new file (Defaults to $conf->global->MAIN_UMASK or 0755 if unavailable). Example: '0444'
* @return int < 0 if KO, 0 = already exists, > 0 if OK
* @return int Return integer < 0 if KO, 0 = already exists, > 0 if OK
*/
function dol_mkdir($dir, $dataroot = '', $newmask = '')
{
@ -9441,7 +9444,7 @@ function dol_osencode($str)
* @param string $fieldid Field to get
* @param int $entityfilter Filter by entity
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
* @return int <0 if KO, Id of code if OK
* @return int Return integer <0 if KO, Id of code if OK
* @see $langs->getLabelFromKey
*/
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')

View file

@ -53,7 +53,7 @@ function jsUnEscape($source)
$unicodeHexVal = substr($source, $pos, 4);
$unicode = hexdec($unicodeHexVal);
$entity = "&#".$unicode.';';
$decodedStr .= utf8_encode($entity);
$decodedStr .= mb_convert_encoding($entity, 'UTF-8', 'ISO-8859-1');
$pos += 4;
} else {
// we have an escaped ascii character
@ -154,9 +154,9 @@ function dol_print_file($langs, $filename, $searchalt = 0)
$content = file_get_contents($formfile);
$isutf8 = utf8_check($content);
if (!$isutf8 && $conf->file->character_set_client == 'UTF-8') {
print utf8_encode($content);
print mb_convert_encoding($content, 'UTF-8', 'ISO-8859-1');
} elseif ($isutf8 && $conf->file->character_set_client == 'ISO-8859-1') {
print utf8_decode($content);
print mb_convert_encoding($content, 'ISO-8859-1');
} else {
print $content;
}
@ -1503,7 +1503,7 @@ function get_string_between($string, $start, $end)
*
* @param string $mask Mask to use
* @param string $value Value
* @return int|string <0 or error string if KO, 0 if OK
* @return int|string Return integer <0 or error string if KO, 0 if OK
*/
function check_value($mask, $value)
{

View file

@ -30,6 +30,11 @@ $maxwidthmini = 128;
$maxheightmini = 72; // 16/9eme
$quality = 80;
if (!defined('IMAGETYPE_WEBP')) {
define('IMAGETYPE_WEBP', 18);
}
/**
* Return default values for image sizes
*
@ -445,7 +450,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95)
break;
}
if ($deg) {
if ($infoImg[2] === 'IMAGETYPE_PNG') { // In fact there is no exif on PNG but just in case
if ($infoImg[2] === IMAGETYPE_PNG) { // In fact there is no exif on PNG but just in case
imagealphablending($img, false);
imagesavealpha($img, true);
$img = imagerotate($img, $deg, imageColorAllocateAlpha($img, 0, 0, 0, 127));
@ -583,6 +588,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
case IMAGETYPE_WBMP: // 15
$imgfonction = 'imagecreatefromwbmp';
break;
case IMAGETYPE_WEBP: // 18
$imgfonction = 'imagecreatefromwebp';
break;
}
if ($imgfonction) {
if (!function_exists($imgfonction)) {
@ -600,11 +608,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
switch ($infoImg[2]) {
case IMAGETYPE_GIF: // 1
$img = imagecreatefromgif($filetoread);
$extImg = '.gif'; // Extension de l'image
$extImg = '.gif';
break;
case IMAGETYPE_JPEG: // 2
$img = imagecreatefromjpeg($filetoread);
$extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg'); // Extension de l'image
$extImg = (preg_match('/\.jpeg$/', $file) ? '.jpeg' : '.jpg');
break;
case IMAGETYPE_PNG: // 3
$img = imagecreatefrompng($filetoread);
@ -618,6 +626,10 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
$img = imagecreatefromwbmp($filetoread);
$extImg = '.bmp';
break;
case IMAGETYPE_WEBP: // 18
$img = imagecreatefromwebp($filetoread);
$extImg = '.webp';
break;
}
// Before PHP8, img was a resource, With PHP8, it is a GdImage
@ -746,6 +758,11 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
$extImgTarget = '.bmp';
$newquality = 'NU';
break;
case IMAGETYPE_WEBP: // 18
$trans_colour = imagecolorallocatealpha($imgThumb, 255, 255, 255, 0);
$extImgTarget = '.webp';
$newquality = $quality;
break;
}
if (function_exists("imagefill")) {
imagefill($imgThumb, 0, 0, $trans_colour);
@ -782,6 +799,9 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
case IMAGETYPE_WBMP: // 15
imagewbmp($imgThumb, $imgThumbName);
break;
case IMAGETYPE_WEBP: // 18
imagewebp($imgThumb, $imgThumbName, $newquality);
break;
}
// Set permissions on file

View file

@ -62,7 +62,7 @@ $shmoffset = 1000; // Max number of entries found into a language file. If too l
* @param string $memoryid Memory id of shared area
* @param mixed $data Data to save. It must not be a null value.
* @param int $expire ttl in seconds, 0 never expire
* @return int <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @return int Return integer <0 if KO, 0 if nothing is done, Nb of bytes written if OK
* @see dol_getcache()
*/
function dol_setcache($memoryid, $data, $expire = 0)
@ -134,7 +134,7 @@ function dol_setcache($memoryid, $data, $expire = 0)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area
* @return int|mixed <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @return int|mixed Return integer <0 if KO, data if OK, null if not found into cache or no caching feature enabled
* @see dol_setcache()
*/
function dol_getcache($memoryid)
@ -214,7 +214,7 @@ function dol_getcache($memoryid)
* Return shared memory address used to store dataset with key memoryid
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
* @return int <0 if KO, Memoy address of shared memory for key
* @return int Return integer <0 if KO, Memoy address of shared memory for key
*/
function dol_getshmopaddress($memoryid)
{
@ -250,7 +250,7 @@ function dol_listshmop()
* @param int $memoryid Memory id of shared area ('main', 'agenda', ...)
* @param string $data Data to save. Must be a not null value.
* @param int $expire ttl in seconds, 0 never expire
* @return int <0 if KO, 0=Caching not available, Nb of bytes written if OK
* @return int Return integer <0 if KO, 0=Caching not available, Nb of bytes written if OK
*/
function dol_setshmop($memoryid, $data, $expire)
{
@ -287,7 +287,7 @@ function dol_setshmop($memoryid, $data, $expire)
* Read a memory area shared by all users, all sessions on server
*
* @param string $memoryid Memory id of shared area ('main', 'agenda', ...)
* @return int <0 if KO, data if OK, Null if no cache enabled or not found
* @return int Return integer <0 if KO, data if OK, Null if no cache enabled or not found
*/
function dol_getshmop($memoryid)
{

View file

@ -32,7 +32,7 @@
* @param string $readdir Directory source (use $destdir when not defined)
* @param string $addfieldentry Array of 1 field entry to add array('key'=>,'type'=>,''label'=>,'visible'=>,'enabled'=>,'position'=>,'notnull'=>','index'=>,'searchall'=>,'comment'=>,'help'=>,'isameasure')
* @param string $delfieldentry Id of field to remove
* @return int|object <=0 if KO, Object if OK
* @return int|object Return integer <=0 if KO, Object if OK
* @see rebuildObjectSql()
*/
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
@ -250,7 +250,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
* @param string $readdir Directory source (use $destdir when not defined)
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
* @param string $moduletype 'external' or 'internal'
* @return int <=0 if KO, >0 if OK
* @return int Return integer <=0 if KO, >0 if OK
* @see rebuildObjectClass()
*/
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
@ -429,7 +429,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
* Get list of existing objects from directory
*
* @param string $destdir Directory
* @return array|int <=0 if KO, array if OK
* @return array|int Return integer <=0 if KO, array if OK
*/
function dolGetListOfObjectClasses($destdir)
{

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