mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
GenericFunctionsFunctionCallArgumentSpacing
This commit is contained in:
@@ -189,7 +189,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$product=new Product($db);
|
||||
$result=$product->fetch($prodids[$prodid]);
|
||||
$result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
||||
$result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
|
||||
if ($result <= 0)
|
||||
{
|
||||
dol_print_error($db, $object->error);
|
||||
|
||||
@@ -118,9 +118,6 @@
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterEquals">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
|
||||
@@ -475,7 +475,7 @@ class AccountancyExport
|
||||
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
|
||||
if (! empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y' ); // elarifr: format must be ddmmyy
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y' ); // elarifr: format must be ddmmyy
|
||||
else
|
||||
$Tab['date_echeance'] = '000000';
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ class BookKeeping extends CommonObject
|
||||
$langs->loadLangs(array("errors"));
|
||||
if (in_array($this->doc_type, array('bank', 'expense_report')))
|
||||
{
|
||||
$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type);
|
||||
$this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ if ($object->id)
|
||||
{
|
||||
$head=various_payment_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("VariousPayment"), -1, 'payment');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("VariousPayment"), -1, 'payment');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Project
|
||||
|
||||
@@ -88,7 +88,7 @@ if ($object->id)
|
||||
|
||||
$head=trip_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@@ -89,7 +89,7 @@ if ($object->id)
|
||||
|
||||
$head=salaries_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'payment');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SalaryPayment"), -1, 'payment');
|
||||
|
||||
// Build file list
|
||||
$filearray=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC), 1);
|
||||
|
||||
@@ -104,7 +104,7 @@ if ($object->id)
|
||||
|
||||
$head=tax_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), -1, 'bill');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), -1, 'bill');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Label of social contribution
|
||||
|
||||
@@ -105,7 +105,7 @@ if ($object->id)
|
||||
|
||||
$head=vat_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'bill');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'bill');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Label of social contribution
|
||||
|
||||
@@ -220,12 +220,12 @@ class FormActions
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="centpercent noborder'.($morecss?' '.$morecss:'').'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Ref', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('By', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Type', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Title', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, '', 1);
|
||||
print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, '', $sortfield, $sortorder, 'center ', 1);
|
||||
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, 'right ', 1);
|
||||
print getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', $page, $param, '', $sortfield, $sortorder, 'center ', 1);
|
||||
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', $page, $param, '', $sortfield, $sortorder, 'right ', 1);
|
||||
print '</tr>';
|
||||
print "\n";
|
||||
|
||||
|
||||
@@ -1120,17 +1120,17 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
||||
if (! empty($yearoffsettype) && ! is_numeric($yearoffsettype) && $yearoffsettype != '=') // yearoffsettype is - or +, so we don't want current year
|
||||
{
|
||||
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{yy\}/i', date("y", $date)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{yy\}/i', date("y", $date)+$yearoffset, $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1)+$yearoffset, $numFinal);
|
||||
}
|
||||
else // we want yyyy to be current year
|
||||
{
|
||||
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{yy\}/i', date("y", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1), $numFinal);
|
||||
$numFinal = preg_replace('/\{yy\}/i', date("y", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1), $numFinal);
|
||||
}
|
||||
$numFinal = preg_replace('/\{mm\}/i', date("m", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{dd\}/i', date("d", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{mm\}/i', date("m", $date), $numFinal);
|
||||
$numFinal = preg_replace('/\{dd\}/i', date("d", $date), $numFinal);
|
||||
|
||||
// Now we replace the counter
|
||||
$maskbefore='{'.$masktri.'}';
|
||||
|
||||
@@ -210,11 +210,11 @@ function dolWebsiteOutput($content)
|
||||
|
||||
$content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=medias([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)modulepart=medias([^\)]*)file=([^\)]*)(["\']?\))/', '\1/wrapper.php\2modulepart=medias\3file=\4\5', $content, -1, $nbrep);
|
||||
|
||||
$content=preg_replace('/(<a[^>]*href=")[^\"]*viewimage\.php([^\"]*)hashp=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2hashp=\3\4', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)hashp=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2hashp=\3\4', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)hashp=([^\)]*)(["\']?\))/', '\1/wrapper.php\2hashp\3\4', $content, -1, $nbrep);
|
||||
$content=preg_replace('/(url\(["\']?)[^\)]*viewimage\.php([^\)]*)hashp=([^\)]*)(["\']?\))/', '\1/wrapper.php\2hashp\3\4', $content, -1, $nbrep);
|
||||
|
||||
$content=preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php([^\"]*)modulepart=mycompany([^\"]*)file=([^\"]*)("[^>]*>)/', '\1/wrapper.php\2modulepart=mycompany\3file=\4\5', $content, -1, $nbrep);
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// VAT Rate
|
||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
|
||||
|
||||
@@ -507,7 +507,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// VAT Rate
|
||||
if ($this->getColumnStatus('vat'))
|
||||
|
||||
@@ -373,7 +373,7 @@ class pdf_baleine extends ModelePDFProjects
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pageposafter+1);
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
@@ -408,7 +408,7 @@ class pdf_baleine extends ModelePDFProjects
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Ref of task
|
||||
$pdf->SetXY($this->posxref, $curY);
|
||||
|
||||
@@ -501,7 +501,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pageposafter+1);
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
@@ -536,7 +536,7 @@ class pdf_beluga extends ModelePDFProjects
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Date
|
||||
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order')
|
||||
|
||||
@@ -304,7 +304,7 @@ class pdf_timespent extends ModelePDFProjects
|
||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||
$pdf->setPage($pageposafter+1);
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
|
||||
@@ -339,7 +339,7 @@ class pdf_timespent extends ModelePDFProjects
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage + $heightoftitleline + 1;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// Ref of task
|
||||
$pdf->SetXY($this->posxref, $curY);
|
||||
|
||||
@@ -446,7 +446,7 @@ class pdf_paiement
|
||||
if ($yp > $this->tab_height -15)
|
||||
{
|
||||
$pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0);
|
||||
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0);
|
||||
$page++;
|
||||
$pdf->AddPage();
|
||||
$this->_pagehead($pdf, $page, 0, $outputlangs);
|
||||
|
||||
@@ -404,7 +404,7 @@ class pdf_standard extends ModelePDFStock
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
$productstatic->id=$objp->rowid;
|
||||
$productstatic->ref = $objp->ref;
|
||||
|
||||
@@ -563,7 +563,7 @@ class pdf_stdmovement extends ModelePDFMovement
|
||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||
}
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||
|
||||
// $objp = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ if ($object->id)
|
||||
|
||||
$head=donation_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Donation"), -1, 'generic');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Donation"), -1, 'generic');
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@@ -92,7 +92,7 @@ if ($object->id)
|
||||
|
||||
$head=expensereport_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/expensereport/list.php?restore_lastsearch_values=1'.(! empty($socid)?'&socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ if ($object->id)
|
||||
|
||||
$head=fichinter_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), -1, 'intervention');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("InterventionCard"), -1, 'intervention');
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@@ -244,23 +244,23 @@ define('MAIN_DB_PREFIX', $dolibarr_main_db_prefix);
|
||||
* To use other version than embeded libraries, define here constant to path. Use '' to use include class path autodetect.
|
||||
*/
|
||||
// Path to root libraries
|
||||
if (! defined('ADODB_PATH')) { define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH))?DOL_DOCUMENT_ROOT.'/includes/adodbtime/':(empty($dolibarr_lib_ADODB_PATH)?'':$dolibarr_lib_ADODB_PATH.'/')); }
|
||||
if (! defined('FPDF_PATH')) { define('FPDF_PATH', (empty($dolibarr_lib_FPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdf/':$dolibarr_lib_FPDF_PATH.'/'); } // Used only for package that can't include tcpdf
|
||||
if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/':$dolibarr_lib_TCPDF_PATH.'/'); }
|
||||
if (! defined('FPDI_PATH')) { define('FPDI_PATH', (empty($dolibarr_lib_FPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdfi/':$dolibarr_lib_FPDI_PATH.'/'); }
|
||||
if (! defined('TCPDI_PATH')) { define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/tcpdi/':$dolibarr_lib_TCPDI_PATH.'/'); }
|
||||
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH))?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/':(empty($dolibarr_lib_NUSOAP_PATH)?'':$dolibarr_lib_NUSOAP_PATH.'/')); }
|
||||
if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpexcel/Classes/':(empty($dolibarr_lib_PHPEXCEL_PATH)?'':$dolibarr_lib_PHPEXCEL_PATH.'/')); }
|
||||
if (! defined('PHPEXCELNEW_PATH')) { define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpoffice/PhpSpreadsheet/':(empty($dolibarr_lib_PHPEXCELNEW_PATH)?'':$dolibarr_lib_PHPEXCELNEW_PATH.'/')); }
|
||||
if (! defined('GEOIP_PATH')) { define('GEOIP_PATH', (!isset($dolibarr_lib_GEOIP_PATH))?DOL_DOCUMENT_ROOT.'/includes/geoip/':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_lib_GEOIP_PATH.'/')); }
|
||||
if (! defined('ODTPHP_PATH')) { define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH))?DOL_DOCUMENT_ROOT.'/includes/odtphp/':(empty($dolibarr_lib_ODTPHP_PATH)?'':$dolibarr_lib_ODTPHP_PATH.'/')); }
|
||||
if (! defined('ODTPHP_PATHTOPCLZIP')) { define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP))?DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/':(empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP)?'':$dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/')); }
|
||||
if (! defined('JS_CKEDITOR')) { define('JS_CKEDITOR', (!isset($dolibarr_js_CKEDITOR))?'':(empty($dolibarr_js_CKEDITOR)?'':$dolibarr_js_CKEDITOR.'/')); }
|
||||
if (! defined('JS_JQUERY')) { define('JS_JQUERY', (!isset($dolibarr_js_JQUERY))?'':(empty($dolibarr_js_JQUERY)?'':$dolibarr_js_JQUERY.'/')); }
|
||||
if (! defined('JS_JQUERY_UI')) { define('JS_JQUERY_UI', (!isset($dolibarr_js_JQUERY_UI))?'':(empty($dolibarr_js_JQUERY_UI)?'':$dolibarr_js_JQUERY_UI.'/')); }
|
||||
if (! defined('JS_JQUERY_FLOT')) { define('JS_JQUERY_FLOT', (!isset($dolibarr_js_JQUERY_FLOT))?'':(empty($dolibarr_js_JQUERY_FLOT)?'':$dolibarr_js_JQUERY_FLOT.'/')); }
|
||||
if (! defined('ADODB_PATH')) { define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH))?DOL_DOCUMENT_ROOT.'/includes/adodbtime/':(empty($dolibarr_lib_ADODB_PATH)?'':$dolibarr_lib_ADODB_PATH.'/')); }
|
||||
if (! defined('FPDF_PATH')) { define('FPDF_PATH', (empty($dolibarr_lib_FPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdf/':$dolibarr_lib_FPDF_PATH.'/'); } // Used only for package that can't include tcpdf
|
||||
if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/':$dolibarr_lib_TCPDF_PATH.'/'); }
|
||||
if (! defined('FPDI_PATH')) { define('FPDI_PATH', (empty($dolibarr_lib_FPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdfi/':$dolibarr_lib_FPDI_PATH.'/'); }
|
||||
if (! defined('TCPDI_PATH')) { define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/tcpdi/':$dolibarr_lib_TCPDI_PATH.'/'); }
|
||||
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH))?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/':(empty($dolibarr_lib_NUSOAP_PATH)?'':$dolibarr_lib_NUSOAP_PATH.'/')); }
|
||||
if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpexcel/Classes/':(empty($dolibarr_lib_PHPEXCEL_PATH)?'':$dolibarr_lib_PHPEXCEL_PATH.'/')); }
|
||||
if (! defined('PHPEXCELNEW_PATH')) { define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpoffice/PhpSpreadsheet/':(empty($dolibarr_lib_PHPEXCELNEW_PATH)?'':$dolibarr_lib_PHPEXCELNEW_PATH.'/')); }
|
||||
if (! defined('GEOIP_PATH')) { define('GEOIP_PATH', (!isset($dolibarr_lib_GEOIP_PATH))?DOL_DOCUMENT_ROOT.'/includes/geoip/':(empty($dolibarr_lib_GEOIP_PATH)?'':$dolibarr_lib_GEOIP_PATH.'/')); }
|
||||
if (! defined('ODTPHP_PATH')) { define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH))?DOL_DOCUMENT_ROOT.'/includes/odtphp/':(empty($dolibarr_lib_ODTPHP_PATH)?'':$dolibarr_lib_ODTPHP_PATH.'/')); }
|
||||
if (! defined('ODTPHP_PATHTOPCLZIP')) { define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP))?DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/':(empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP)?'':$dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/')); }
|
||||
if (! defined('JS_CKEDITOR')) { define('JS_CKEDITOR', (!isset($dolibarr_js_CKEDITOR))?'':(empty($dolibarr_js_CKEDITOR)?'':$dolibarr_js_CKEDITOR.'/')); }
|
||||
if (! defined('JS_JQUERY')) { define('JS_JQUERY', (!isset($dolibarr_js_JQUERY))?'':(empty($dolibarr_js_JQUERY)?'':$dolibarr_js_JQUERY.'/')); }
|
||||
if (! defined('JS_JQUERY_UI')) { define('JS_JQUERY_UI', (!isset($dolibarr_js_JQUERY_UI))?'':(empty($dolibarr_js_JQUERY_UI)?'':$dolibarr_js_JQUERY_UI.'/')); }
|
||||
if (! defined('JS_JQUERY_FLOT')) { define('JS_JQUERY_FLOT', (!isset($dolibarr_js_JQUERY_FLOT))?'':(empty($dolibarr_js_JQUERY_FLOT)?'':$dolibarr_js_JQUERY_FLOT.'/')); }
|
||||
// Other required path
|
||||
if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF))?DOL_DOCUMENT_ROOT.'/includes/fonts/Aerial.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF)?'':$dolibarr_font_DOL_DEFAULT_TTF)); }
|
||||
if (! defined('DOL_DEFAULT_TTF')) { define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF))?DOL_DOCUMENT_ROOT.'/includes/fonts/Aerial.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF)?'':$dolibarr_font_DOL_DEFAULT_TTF)); }
|
||||
if (! defined('DOL_DEFAULT_TTF_BOLD')) { define('DOL_DEFAULT_TTF_BOLD', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD))?DOL_DOCUMENT_ROOT.'/includes/fonts/AerialBd.ttf':(empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD)?'':$dolibarr_font_DOL_DEFAULT_TTF_BOLD)); }
|
||||
|
||||
|
||||
|
||||
@@ -841,7 +841,7 @@ if (empty($reshook))
|
||||
|
||||
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||
if ($result > 0)
|
||||
{
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
@@ -1927,11 +1927,11 @@ elseif (! empty($object->id))
|
||||
print '</td><td>';
|
||||
if ($action == 'editconditions')
|
||||
{
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
@@ -2507,11 +2507,11 @@ else
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editconditions')
|
||||
{
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
@@ -698,7 +698,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
||||
if ($totalrecudeposits) print '+'.price($totalrecudeposits);
|
||||
print '</b></td>';
|
||||
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
|
||||
print '<td align="right"><b>'.price(price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).'</b></td>';
|
||||
print '<td align="center" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -598,7 +598,7 @@ if ($action == 'confirm_refuse' && GETPOST('confirm', 'alpha') == 'yes')
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message.= "\n";
|
||||
$message.= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message.= GETPOST('detail_refuse','alpha')."\n\n";
|
||||
$message.= GETPOST('detail_refuse', 'alpha')."\n\n";
|
||||
|
||||
$message.= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ if ($object->id)
|
||||
|
||||
$head = loan_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Loan"), -1, 'bill');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("Loan"), -1, 'bill');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref loan
|
||||
|
||||
@@ -97,24 +97,24 @@ function testSqlAndScriptInject($val, $type)
|
||||
// For SQL Injection (only GET are used to be included into bad escaped SQL requests)
|
||||
if ($type == 1 || $type == 3)
|
||||
{
|
||||
$inj += preg_match('/delete\s+from/i', $val);
|
||||
$inj += preg_match('/create\s+table/i', $val);
|
||||
$inj += preg_match('/insert\s+into/i', $val);
|
||||
$inj += preg_match('/select\s+from/i', $val);
|
||||
$inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
|
||||
$inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login
|
||||
$inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database
|
||||
$inj += preg_match('/delete\s+from/i', $val);
|
||||
$inj += preg_match('/create\s+table/i', $val);
|
||||
$inj += preg_match('/insert\s+into/i', $val);
|
||||
$inj += preg_match('/select\s+from/i', $val);
|
||||
$inj += preg_match('/into\s+(outfile|dumpfile)/i', $val);
|
||||
$inj += preg_match('/user\s*\(/i', $val); // avoid to use function user() that return current database login
|
||||
$inj += preg_match('/information_schema/i', $val); // avoid to use request that read information_schema database
|
||||
}
|
||||
if ($type == 3)
|
||||
{
|
||||
$inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val);
|
||||
$inj += preg_match('/select|update|delete|replace|group\s+by|concat|count|from/i', $val);
|
||||
}
|
||||
if ($type != 2) // Not common key strings, so we can check them both on GET and POST
|
||||
{
|
||||
$inj += preg_match('/updatexml\(/i', $val);
|
||||
$inj += preg_match('/update.+set.+=/i', $val);
|
||||
$inj += preg_match('/union.+select/i', $val);
|
||||
$inj += preg_match('/(\.\.%2f)+/i', $val);
|
||||
$inj += preg_match('/updatexml\(/i', $val);
|
||||
$inj += preg_match('/update.+set.+=/i', $val);
|
||||
$inj += preg_match('/union.+select/i', $val);
|
||||
$inj += preg_match('/(\.\.%2f)+/i', $val);
|
||||
}
|
||||
// For XSS Injection done by adding javascript with script
|
||||
// This is all cases a browser consider text is javascript:
|
||||
|
||||
@@ -55,9 +55,9 @@ if (! $sortfield)
|
||||
$startdate=$enddate='';
|
||||
|
||||
if (!empty($_POST['startdatemonth']))
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
if (!empty($_POST['enddatemonth']))
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
|
||||
// Security check
|
||||
if ($user->rights->margins->read->all) {
|
||||
|
||||
@@ -58,9 +58,9 @@ if (! $sortorder) $sortorder="ASC";
|
||||
$startdate=$enddate='';
|
||||
|
||||
if (!empty($_POST['startdatemonth']))
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
$startdate = dol_mktime(0, 0, 0, $_POST['startdatemonth'], $_POST['startdateday'], $_POST['startdateyear']);
|
||||
if (!empty($_POST['enddatemonth']))
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1553,7 +1553,7 @@ class Reception extends CommonObject
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->subprice, $langs->trans("ReceptionClassifyClosedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
|
||||
if ($result < 0) {
|
||||
$this->error = $mouvS->error;
|
||||
@@ -1718,7 +1718,7 @@ class Reception extends CommonObject
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, $obj->fk_origin_stock);
|
||||
if ($result < 0) {
|
||||
$this->error = $mouvS->error;
|
||||
$this->errors = $mouvS->errors;
|
||||
@@ -1856,7 +1856,7 @@ class Reception extends CommonObject
|
||||
// line with batch detail
|
||||
|
||||
// We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
$result=$mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionBackToDraftInDolibarr", $this->ref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch);
|
||||
if ($result < 0) {
|
||||
$this->error = $mouvS->error;
|
||||
$this->errors = $mouvS->errors;
|
||||
|
||||
@@ -88,7 +88,7 @@ if ($object->id)
|
||||
|
||||
$head=resource_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), -1, 'resource');
|
||||
dol_fiche_head($head, 'documents', $langs->trans("ResourceSingular"), -1, 'resource');
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@@ -78,7 +78,7 @@ if ($query=="cat")
|
||||
$new_height = $h*0.3;
|
||||
$icon_p = imagecreatetruecolor($new_width, $new_height);
|
||||
imagecopyresampled($icon_p, $icon, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
|
||||
imagecopymerge($image_p, $icon_p, 0, 0, 0, 0, $new_width, $new_height, 100);
|
||||
imagecopymerge($image_p, $icon_p, 0, 0, 0, 0, $new_width, $new_height, 100);
|
||||
|
||||
// Output
|
||||
imagejpeg($image_p, null, 100);
|
||||
|
||||
@@ -1001,7 +1001,7 @@ class Website extends CommonObject
|
||||
}
|
||||
|
||||
dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/image/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/image/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists
|
||||
dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists
|
||||
dolCopyDir($conf->website->dir_temp.'/'.$object->ref.'/medias/js/websitekey', $conf->website->dir_output.'/'.$object->ref.'/medias/js/'.$object->ref, 0, 1); // Medias can be shared, do not overwrite if exists
|
||||
|
||||
$sqlfile = $conf->website->dir_temp.'/'.$object->ref.'/website_pages.sql';
|
||||
|
||||
|
||||
@@ -1127,7 +1127,7 @@ if ($action == 'updatemeta')
|
||||
$objectpage->fk_website = $object->id;
|
||||
|
||||
// Check parameters
|
||||
if (! preg_match('/^[a-z0-9\-\_]+$/i', GETPOST('WEBSITE_PAGENAME', 'alpha')))
|
||||
if (! preg_match('/^[a-z0-9\-\_]+$/i', GETPOST('WEBSITE_PAGENAME', 'alpha')))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
|
||||
Reference in New Issue
Block a user