Skip to content

Commit

Permalink
Merge branch 'develop' into dev_updateSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Mar 7, 2024
2 parents 3231777 + 1aa0f82 commit f528b44
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 41 deletions.
2 changes: 1 addition & 1 deletion htdocs/accountancy/class/bookkeeping.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $o
} elseif ($key == 't.reconciled_option') {
$sqlwhere[] = 't.lettering_code IS NULL';
} else {
$sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->escape($this->db->escapeforlike($value))."%'";
$sqlwhere[] = $this->db->sanitize($key)." LIKE '%".$this->db->escape($this->db->escapeforlike($value))."%'";
}
}
}
Expand Down
26 changes: 13 additions & 13 deletions htdocs/core/lib/ajax.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -628,19 +628,19 @@ function(response) {
/**
* On/off button for constant
*
* @param string $code Name of constant
* @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid'))
* @param int $entity Entity. Current entity is used if null.
* @param int $revertonoff 1=Revert on/off
* @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant
* @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input)
* @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin.
* @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code.
* @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it
* @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red'
* @param string $mode Add parameter &mode= to the href link (Used for href link)
* @param string $morecss More CSS
* @return string
* @param string $code Name of constant
* @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid'))
* @param int|null $entity Entity. Current entity is used if null.
* @param int $revertonoff 1=Revert on/off
* @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant
* @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input)
* @param int $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin.
* @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code.
* @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it
* @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red'
* @param string $mode Add parameter &mode= to the href link (Used for href link)
* @param string $morecss More CSS
* @return string
*/
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '', $morecss = 'inline-block')
{
Expand Down
17 changes: 10 additions & 7 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -6890,7 +6890,7 @@ function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournpric
if (($mysoc->country_code == $thirdpartytouse->country_code)
|| (in_array($mysoc->country_code, array('FR', 'MC')) && in_array($thirdpartytouse->country_code, array('FR', 'MC')))
|| (in_array($mysoc->country_code, array('MQ', 'GP')) && in_array($thirdpartytouse->country_code, array('MQ', 'GP')))
) {
) {
// If country of thirdparty to consider is ours
if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object
$result = $product->get_buyprice($idprodfournprice, 0, 0, 0);
Expand Down Expand Up @@ -9756,13 +9756,13 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
}

/**
* Check if a variable with name $var start with $text.
* Check if a variable with name $var startx with $text.
* Can be used to forge dol_eval() conditions.
*
* @param $var string Variable
* @param $regextext string Text that must be a valid regex string
* @param $matchrule int 1=Test if start with, 0=Test if equal
* @return boolean|string True or False, text if bad use.
* @param string $var Variable
* @param string $regextext Text that must be a valid regex string
* @param int $matchrule 1=Test if start with, 0=Test if equal
* @return boolean|string True or False, text if bad usage.
*/
function isStringVarMatching($var, $regextext, $matchrule = 1)
{
Expand Down Expand Up @@ -13078,6 +13078,8 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
}

$histo = array();
'@phan-var-force array<int,array{type:string,tododone:string,id:string,datestart:int|string,dateend:int|string,note:string,message:string,percent:string,userid:string,login:string,userfirstname:string,userlastname:string,userphoto:string,msg_from?:string,contact_id?:string,socpeopleassigned?:int[],lastname?:string,firstname?:string,fk_element?:int,elementtype?:string,acode:string,alabel?:string,libelle?:string,apicto?:string}> $histo';

$numaction = 0;
$now = dol_now();

Expand Down Expand Up @@ -13157,7 +13159,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
}

$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
if ($force_filter_contact === false) {
if (!$force_filter_contact) {
if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur')) && $filterobj->id) {
$sql .= " AND a.fk_soc = ".((int) $filterobj->id);
} elseif (is_object($filterobj) && get_class($filterobj) == 'Project' && $filterobj->id) {
Expand Down Expand Up @@ -13285,6 +13287,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);

'@phan-var-force array{apicto:string,contact_id:string,dp:string,dp2:string,firstname:string,label:string,message:string,msg_from:string,ref:string,type:string,user_lastname:string} $obj';
if ($obj->type == 'action') {
$contactaction = new ActionComm($db);
$contactaction->id = $obj->id;
Expand Down
24 changes: 12 additions & 12 deletions htdocs/core/lib/pdf.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
* @param Contact|string|null $targetcontact Target contact object
* @param int $usecontact Use contact instead of company
* @param string $mode Address type ('source', 'target', 'targetwithdetails', 'targetwithdetails_xxx': target but include also phone/fax/email/url)
* @param Object $object Object we want to build document for
* @param Object|null $object Object we want to build document for
* @return string|int String with full address or -1 if KO
*/
function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $targetcontact = '', $usecontact = 0, $mode = 'source', $object = null)
Expand Down Expand Up @@ -718,7 +718,7 @@ function pdf_build_address($outputlangs, $sourcecompany, $targetcompany = '', $t
/**
* Show header of page for PDF generation
*
* @param TCPDF $pdf Object PDF
* @param TCPDF $pdf Object PDF
* @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page
* @return void
Expand Down Expand Up @@ -752,11 +752,11 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
/**
* Return array of possible substitutions for PDF content (without external module substitutions).
*
* @param Translate $outputlangs Output language
* @param array $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
* @param Object $object Object
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
* @param array $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
* @param Translate $outputlangs Output language
* @param array|null $exclude Array of family keys we want to exclude. For example array('mycompany', 'object', 'date', 'user', ...)
* @param Object|null $object Object
* @param int $onlykey 1=Do not calculate some heavy values of keys (performance enhancement when we need only the keys), 2=Values are truncated and html sanitized (to use for help tooltip)
* @param array|null $include Array of family keys we want to include. For example array('system', 'mycompany', 'object', 'objectamount', 'date', 'user', ...)
* @return array Array of substitutions
*/
function pdf_getSubstitutionArray($outputlangs, $exclude = null, $object = null, $onlykey = 0, $include = null)
Expand Down Expand Up @@ -2296,11 +2296,11 @@ function pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails = 0)
/**
* Return line percent
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager|null $hookmanager Hook manager instance
* @return string
*/
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/expedition/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2763,7 +2763,7 @@

// Presend form
$modelmail = 'shipping_send';
$defaulttopic = $langs->trans('SendShippingRef');
$defaulttopic = 'SendShippingRef';
$diroutput = $conf->expedition->dir_output.'/sending';
$trackid = 'shi'.$object->id;

Expand Down
2 changes: 1 addition & 1 deletion htdocs/hrm/class/job.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public function fetchLines()
* @param string $filtermode No more used
* @return array|int int <0 if KO, array of pages if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = '', $filtermode = 'AND')
{
dol_syslog(__METHOD__, LOG_DEBUG);

Expand Down
2 changes: 1 addition & 1 deletion htdocs/loan/class/loan.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Loan extends CommonObject
public $fk_project;

/**
* @var int totalpaid
* @var float totalpaid
*/
public $totalpaid;

Expand Down
10 changes: 5 additions & 5 deletions htdocs/modulebuilder/template/class/api_mymodule.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct()
* @param int $id ID of myobject
* @return Object Object with cleaned properties
*
* @url GET myobjects/{id}
* @url GET mymodule/myobjects/{id}
*
* @throws RestException 403 Not allowed
* @throws RestException 404 Not found
Expand Down Expand Up @@ -103,7 +103,7 @@ public function get($id)
* @throws RestException 403 Not allowed
* @throws RestException 503 System error
*
* @url GET /myobjects/
* @url GET /mymodule/myobjects/
*/
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '', $properties = '')
{
Expand Down Expand Up @@ -191,7 +191,7 @@ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100,
* @throws RestException 403 Not allowed
* @throws RestException 500 System error
*
* @url POST myobjects/
* @url POST mymodule/myobjects/
*/
public function post($request_data = null)
{
Expand Down Expand Up @@ -232,7 +232,7 @@ public function post($request_data = null)
* @throws RestException 404 Not found
* @throws RestException 500 System error
*
* @url PUT myobjects/{id}
* @url PUT mymodule/myobjects/{id}
*/
public function put($id, $request_data = null)
{
Expand Down Expand Up @@ -282,7 +282,7 @@ public function put($id, $request_data = null)
* @throws RestException 409 Nothing to do
* @throws RestException 500 System error
*
* @url DELETE myobjects/{id}
* @url DELETE mymodule/myobjects/{id}
*/
public function delete($id)
{
Expand Down

0 comments on commit f528b44

Please sign in to comment.