Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
This commit is contained in:
commit
e8e7a3fe95
18 changed files with 71 additions and 33 deletions
23
.github/workflows/pre-commit.yml
vendored
23
.github/workflows/pre-commit.yml
vendored
|
|
@ -65,7 +65,17 @@ jobs:
|
|||
|
||||
- name: Setup PHPCS
|
||||
uses: shivammathur/setup-php@v2
|
||||
if: steps.changed-php.outputs.any_changed == 'true'
|
||||
# Install when we're going to run phpcs
|
||||
if: |
|
||||
steps.changed-php.outputs.any_changed == 'true'
|
||||
||
|
||||
(
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
)
|
||||
)
|
||||
with:
|
||||
php-version: 8.1
|
||||
coverage: none # disable xdebug, pcov
|
||||
|
|
@ -79,6 +89,17 @@ jobs:
|
|||
set -o pipefail
|
||||
pre-commit run php-cs --files ${ALL_CHANGED_FILES} | tee -a ${RAW_LOG}
|
||||
|
||||
- name: Run some pre-commit hooks on all files on push to "main" branches
|
||||
if: |
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
)
|
||||
run: |
|
||||
set -o pipefail
|
||||
pre-commit run -a php-cs | tee -a ${RAW_LOG}
|
||||
|
||||
# If error, we convert log in the checkstyle format
|
||||
- name: Convert Raw Log to CheckStyle format
|
||||
if: ${{ failure() }}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ if (!$user->admin) {
|
|||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'stock';
|
||||
|
|
@ -48,6 +49,7 @@ $type = 'stock';
|
|||
/*
|
||||
* Action
|
||||
*/
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$reg = array();
|
||||
|
||||
|
|
@ -196,7 +198,7 @@ if (isModEnabled('productbatch')) {
|
|||
// STOCK_CALCULATE_ON_RECEPTION_CLOSE
|
||||
$incmode = $langs->trans('StockOnReceptionOnClosing');
|
||||
}
|
||||
print info_admin($langs->trans("WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
|
||||
print info_admin($langs->transnoentitiesnoconv("WhenProductBatchModuleOnOptionAreForced", $descmode, $incmode));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ if ($object->id > 0) {
|
|||
print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
// Link to other agenda views
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ $head = actions_prepare_head($object);
|
|||
print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
// Link to other agenda views
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
|
|
|||
|
|
@ -915,6 +915,12 @@ while ($currentdaytoshow < $lastdaytoshow) {
|
|||
}
|
||||
}
|
||||
$sql .= " AND u.statut = 1";
|
||||
if ($filtert > 0) {
|
||||
$sql .= " AND u.rowid = ".((int) $filtert);
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
|
||||
}
|
||||
if ($user->socid > 0) {
|
||||
// External users should see only contacts of their company
|
||||
$sql .= " AND u.fk_soc = ".((int) $user->socid);
|
||||
|
|
|
|||
|
|
@ -738,8 +738,6 @@ class FactureRec extends CommonInvoice
|
|||
$line->total_tva = $objp->total_tva;
|
||||
$line->total_ttc = $objp->total_ttc;
|
||||
|
||||
//$line->code_ventilation = $objp->fk_code_ventilation;
|
||||
|
||||
$line->fk_product_fournisseur_price = $objp->fk_product_fournisseur_price;
|
||||
$line->fk_fournprice = $objp->fk_product_fournisseur_price; // For backward compatibility
|
||||
|
||||
|
|
@ -2276,7 +2274,7 @@ class FactureLigneRec extends CommonInvoiceLine
|
|||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_ttc = $objp->total_ttc;
|
||||
//$this->code_ventilation = $objp->fk_code_ventilation;
|
||||
|
||||
$this->rang = $objp->rang;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
|
|
|||
|
|
@ -2347,6 +2347,7 @@ class Facture extends CommonInvoice
|
|||
$line->total_localtax1 = $objp->total_localtax1;
|
||||
$line->total_localtax2 = $objp->total_localtax2;
|
||||
$line->total_ttc = $objp->total_ttc;
|
||||
|
||||
$line->code_ventilation = $objp->fk_code_ventilation;
|
||||
$line->fk_fournprice = $objp->fk_fournprice;
|
||||
$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $line->fk_fournprice, $objp->pa_ht);
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ $langs->loadLangs(array('bills', 'companies', 'products', 'categories'));
|
|||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||
|
||||
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||
$id = (GETPOST('id', 'int') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$socid = GETPOSTINT('socid');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
|
|
@ -82,7 +82,6 @@ if ($contextpage == 'poslist') {
|
|||
$optioncss = 'print';
|
||||
}
|
||||
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
|
||||
$search_refcustomer = GETPOST('search_refcustomer', 'alpha');
|
||||
|
|
@ -580,9 +579,19 @@ $facturestatic = new Facture($db);
|
|||
$formcompany = new FormCompany($db);
|
||||
$companystatic = new Societe($db);
|
||||
$companyparent = new Societe($db);
|
||||
|
||||
$company_url_list = array();
|
||||
$subtypearray = $object->getArrayOfInvoiceSubtypes(0);
|
||||
$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' '.$soc->name : '');
|
||||
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
if (empty($search_company)) {
|
||||
$search_company = $soc->name;
|
||||
}
|
||||
}
|
||||
|
||||
$title = $langs->trans('BillsCustomers').' '.($socid > 0 ? ' - '.$soc->name : '');
|
||||
$help_url = 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
|
|
@ -970,14 +979,6 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s
|
|||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
if (empty($search_company)) {
|
||||
$search_company = $soc->name;
|
||||
}
|
||||
}
|
||||
|
||||
$param = '&socid='.urlencode($socid);
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
|
|
|
|||
|
|
@ -9514,7 +9514,7 @@ abstract class CommonObject
|
|||
$this->$field = (float) $obj->$field;
|
||||
}
|
||||
} else {
|
||||
if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||
if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) {
|
||||
$this->$field = (int) $obj->$field;
|
||||
} else {
|
||||
$this->$field = null;
|
||||
|
|
@ -9529,7 +9529,7 @@ abstract class CommonObject
|
|||
$this->$field = (float) $obj->$field;
|
||||
}
|
||||
} else {
|
||||
if (isset($obj->$field) && !is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1)) {
|
||||
if (isset($obj->$field) && (!is_null($obj->$field) || (isset($info['notnull']) && $info['notnull'] == 1))) {
|
||||
$this->$field = (float) $obj->$field;
|
||||
} else {
|
||||
$this->$field = null;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class CUnits extends CommonDict
|
|||
$this->libelle = trim($this->short_label);
|
||||
}
|
||||
if (isset($this->unit_type)) {
|
||||
$this->active = trim($this->unit_type);
|
||||
$this->unit_type = trim($this->unit_type);
|
||||
}
|
||||
if (isset($this->active)) {
|
||||
$this->active = trim($this->active);
|
||||
|
|
@ -103,14 +103,14 @@ class CUnits extends CommonDict
|
|||
$sql .= "code,";
|
||||
$sql .= "label,";
|
||||
$sql .= "short_label,";
|
||||
$sql .= "unit_type";
|
||||
$sql .= "unit_type,";
|
||||
$sql .= "scale";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= " ".(!isset($this->id) ? 'NULL' : "'".$this->db->escape($this->id)."'").",";
|
||||
$sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").",";
|
||||
$sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").",";
|
||||
$sql .= " ".(!isset($this->short_label) ? 'NULL' : "'".$this->db->escape($this->short_label)."'").",";
|
||||
$sql .= " ".(!isset($this->unit_type) ? 'NULL' : "'".$this->db->escape($this->unit_type)."'");
|
||||
$sql .= " ".(!isset($this->unit_type) ? 'NULL' : "'".$this->db->escape($this->unit_type)."'").",";
|
||||
$sql .= " ".(!isset($this->scale) ? 'NULL' : "'".$this->db->escape($this->scale)."'");
|
||||
$sql .= ")";
|
||||
|
||||
|
|
@ -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 Return integer <0 if KO, Id of code if OK
|
||||
* @return int|string Return integer <0 if KO, Id of code if OK (or $code if $mode is different from '', 'short_label' or 'code')
|
||||
*/
|
||||
public function getUnitFromCode($code, $mode = 'code', $unit_type = '')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
|
|||
* @param Translate $langs Translation object
|
||||
* @return int Height in mm of the bottom-page QR invoice. Can be zero if not on right page; not enabled
|
||||
*/
|
||||
protected function getHeightForQRInvoice(int $pagenbr, Facture $object, Translate $langs): int
|
||||
protected function getHeightForQRInvoice(int $pagenbr, Facture $object, Translate $langs)
|
||||
{
|
||||
if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') {
|
||||
// Keep it, to reset it after QRinvoice getter
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ foreach (array('internal', 'external') as $source) {
|
|||
$entry->type = $contact['libelle'];
|
||||
$entry->nature = "";
|
||||
$entry->nature_html = "";
|
||||
$entry->thirdparty_id = 0;
|
||||
$entry->thirdparty_html = "";
|
||||
$entry->thirdparty_name = "";
|
||||
$entry->contact_html = "";
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class InterfaceLogevents extends DolibarrTriggers
|
|||
* @return int if KO: <0, if no trigger ran: 0, if OK: >0
|
||||
* @throws Exception dol_syslog can throw Exceptions
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf): int
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (getDolGlobalString('MAIN_LOGEVENTS_DISABLE_ALL')) {
|
||||
return 0; // Log events is disabled (hidden features)
|
||||
|
|
|
|||
|
|
@ -2044,7 +2044,7 @@ class CommandeFournisseur extends CommonOrder
|
|||
$this->line->total_localtax2 = $total_localtax2;
|
||||
$this->line->total_ttc = $total_ttc;
|
||||
$this->line->product_type = $type;
|
||||
$this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0);
|
||||
$this->line->special_code = (!empty($special_code) ? $special_code : 0);
|
||||
$this->line->origin = $origin;
|
||||
$this->line->origin_id = $origin_id;
|
||||
$this->line->fk_unit = $fk_unit;
|
||||
|
|
|
|||
|
|
@ -407,7 +407,15 @@ $thirdparty = new Societe($db);
|
|||
$subtypearray = $object->getArrayOfInvoiceSubtypes(0);
|
||||
$now = dol_now();
|
||||
|
||||
$title = $langs->trans("BillsSuppliers").($socid ? ' '.$soc->name : '');
|
||||
if ($socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($socid);
|
||||
if (empty($search_company)) {
|
||||
$search_company = $soc->name;
|
||||
}
|
||||
}
|
||||
|
||||
$title = $langs->trans("BillsSuppliers").($socid ? ' - '.$soc->name : '');
|
||||
$help_url = 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores';
|
||||
|
||||
// Build and execute select
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ if (!$ret) {
|
|||
|
||||
print dol_get_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ if (empty($reshook)) {
|
|||
|
||||
if ($pay != "delayed") {
|
||||
$payment->create($user);
|
||||
$payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
|
||||
$res = $payment->addPaymentToBank($user, 'payment', '(CustomerInvoicePayment)', $bankaccount, '', '');
|
||||
if ($res < 0) {
|
||||
$error++;
|
||||
dol_htmloutput_errors($langs->trans('ErrorNoPaymentDefined'), $payment->errors, 1);
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ class Ticket extends CommonObject
|
|||
'fk_contract' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'Contract', 'visible'=>-1, 'enabled'=>'$conf->contract->enabled', 'position'=>53, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToContract"),
|
||||
//'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ?
|
||||
'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1, 'csslist'=>'nowraponall'),
|
||||
'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1),
|
||||
'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1, 'csslist'=>'nowraponall'),
|
||||
'date_last_msg_sent' => array('type'=>'datetime', 'label'=>'TicketLastMessageDate', 'visible'=>0, 'enabled'=>1, 'position'=>502, 'notnull'=>-1),
|
||||
'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>505, 'notnull'=>1, 'csslist'=>'tdoverflowmax100 maxwidth150onsmartphone'),
|
||||
'date_close' => array('type'=>'datetime', 'label'=>'TicketCloseOn', 'visible'=>-1, 'enabled'=>1, 'position'=>510, 'notnull'=>1),
|
||||
|
|
@ -344,7 +344,7 @@ class Ticket extends CommonObject
|
|||
'email_date' => array('type'=>'datetime', 'label'=>'EmailDate', 'visible'=>-2, 'enabled'=>1, 'position'=>541),
|
||||
'progress' => array('type'=>'integer', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>2, 'csslist'=>'width50'),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'getDolGlobalString("TICKET_ENABLE_RESOLUTION")', 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 2 => 'Assigned', 3 => 'InProgress', 5 => 'NeedMoreInformation', 7 => 'OnHold', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
|
|
|||
Loading…
Reference in a new issue