Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add phpdoc in mailing modules #31786

Merged
merged 19 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/phpstan_baseline.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'PHPStan'
name: 'PHPStan baseline'

on:
# Every Monday we want to refresh the baseline
# Every Thursday we want to refresh the baseline
schedule:
- cron: '0 6 * * 1'
- cron: '0 6 * * 4'

# We want to be able to manually refresh the baseline too
workflow_dispatch:
Expand Down Expand Up @@ -61,6 +61,7 @@ jobs:
commit_message: PHPStan > Update baseline
target_branch: develop
pr_create: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 1 || 0 }}
# pr_create: 1
pr_title: PHPStan > Update baseline
pr_reviewer: eldy
pr_body: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ repos:
- id: end-of-file-fixer
# Check that there are no completely merged file conflicts
- id: check-merge-conflict
stages: [commit, pre-rebase, pre-commit, pre-merge-commit]
stages: [pre-rebase, pre-commit, pre-merge-commit]
# Check that files with shebangs have the executable bit set (in git)
- id: check-executables-have-shebangs
# Check that shell files are executables
Expand Down Expand Up @@ -252,7 +252,7 @@ repos:
rev: 3.1.0
hooks:
- id: sqlfluff-lint
stages: [commit, manual] # manual needed for ci
stages: [pre-commit, manual] # manual needed for ci
exclude: (?x)^
(dev/initdemo/mysqldump_.*\.sql
|htdocs/core/menus/init_menu_auguria\.sql
Expand Down
66 changes: 0 additions & 66 deletions build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15450,18 +15450,6 @@ parameters:
count: 1
path: ../../htdocs/core/modules/import/import_xlsx.modules.php

-
message: '#^Property mailing_advthirdparties\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/advthirdparties.modules.php

-
message: '#^Property mailing_advthirdparties\:\:\$require_module has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/advthirdparties.modules.php

-
message: '#^Property mailing_contacts1\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
Expand Down Expand Up @@ -15522,60 +15510,6 @@ parameters:
count: 1
path: ../../htdocs/core/modules/mailings/modules_mailings.php

-
message: '#^Property mailing_partnership\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/partnership.modules.php

-
message: '#^Property mailing_partnership\:\:\$require_module has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/partnership.modules.php

-
message: '#^Property mailing_pomme\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/pomme.modules.php

-
message: '#^Property mailing_pomme\:\:\$require_module has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/pomme.modules.php

-
message: '#^Property mailing_thirdparties\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/thirdparties.modules.php

-
message: '#^Property mailing_thirdparties\:\:\$require_module has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/thirdparties.modules.php

-
message: '#^Property mailing_thirdparties_services_expired\:\:\$arrayofproducts has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/thirdparties_services_expired.modules.php

-
message: '#^Property mailing_thirdparties_services_expired\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/thirdparties_services_expired.modules.php

-
message: '#^Property mailing_thirdparties_services_expired\:\:\$require_module has no type specified\.$#'
identifier: missingType.property
count: 1
path: ../../htdocs/core/modules/mailings/thirdparties_services_expired.modules.php

-
message: '#^Property mailing_xinputfile\:\:\$require_admin has no type specified\.$#'
identifier: missingType.property
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,19 +571,19 @@ abstract class CommonObject
public $fk_account;

/**
* @var string Public note
* @var ?string Public note
* @see update_note()
*/
public $note_public;

/**
* @var string Private note
* @var ?string Private note
* @see update_note()
*/
public $note_private;

/**
* @var string
* @var ?string
* @deprecated Use $note_private instead.
* @see $note_private
*/
Expand Down
25 changes: 21 additions & 4 deletions htdocs/core/modules/mailings/advthirdparties.modules.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This file is an example to follow to add your own email selector inside
* the Dolibarr email tool.
Expand All @@ -26,18 +27,34 @@
*/
class mailing_advthirdparties extends MailingTargets
{
/**
* @var string name of mailing module
*/
public $name = 'ThirdPartyAdvancedTargeting';
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found

/**
* @var string This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
*/
public $desc = "Third parties";

/**
* @var int
*/
public $require_admin = 0;

/**
* @var string[]
*/
public $require_module = array("none"); // This module should not be displayed as Selector in mailing

/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'company';

/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("societe")';


Expand Down
4 changes: 4 additions & 0 deletions htdocs/core/modules/mailings/contacts1.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,6 +40,9 @@ class mailing_contacts1 extends MailingTargets
public $require_module = array("societe"); // Module mailing actif si modules require_module actifs
public $require_admin = 0; // Module mailing actif pour user admin ou non

/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("societe")';

/**
Expand Down
20 changes: 15 additions & 5 deletions htdocs/core/modules/mailings/eventorganization.modules.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2018-2018 Andre Schild <[email protected]>
* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2018-2018 Andre Schild <[email protected]>
* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This file is an example to follow to add your own email selector inside
* the Dolibarr email tool.
Expand Down Expand Up @@ -31,15 +32,24 @@ class mailing_eventorganization extends MailingTargets
public $name = 'AttendeesOfOrganizedEvent';
public $desc = "Attendees of an organized event";

/**
* @var int
*/
public $require_admin = 0;

public $require_module = array(); // This module allows to select by categories must be also enabled if category module is not activated
/**
* @var string[] This module allows to select by categories must be also enabled if category module is not activated
*/
public $require_module = array();

/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'conferenceorbooth';

/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("eventorganization")';


Expand Down
7 changes: 5 additions & 2 deletions htdocs/core/modules/mailings/fraise.modules.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2005 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -42,6 +42,9 @@ class mailing_fraise extends MailingTargets

public $require_module = array('adherent');

/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("member")';

/**
Expand Down
29 changes: 23 additions & 6 deletions htdocs/core/modules/mailings/partnership.modules.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2018-2018 Andre Schild <[email protected]>
* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2018-2018 Andre Schild <[email protected]>
* Copyright (C) 2005-2010 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This file is an example to follow to add your own email selector inside
* the Dolibarr email tool.
Expand All @@ -27,19 +28,35 @@
*/
class mailing_partnership extends MailingTargets
{
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
/**
* @var string name of mailing module
*/
public $name = 'PartnershipThirdpartiesOrMembers';

/**
* @var string This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
*/
public $desc = "Thirdparties or members included into a partnership program";

/**
* @var int
*/
public $require_admin = 0;

/**
* @var string[]
*
*/
public $require_module = array('partnership'); // This module allows to select by categories must be also enabled if category module is not activated

/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/
public $picto = 'partnership';

/**
* @var string condition to enable module
*/
public $enabled = 'isModEnabled("partnership")';


Expand All @@ -50,7 +67,7 @@ class mailing_partnership extends MailingTargets
*/
public function __construct($db)
{
global $conf, $langs;
global $langs;
$langs->load('companies');

$this->db = $db;
Expand Down
25 changes: 20 additions & 5 deletions htdocs/core/modules/mailings/pomme.modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (C) 2005-2011 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2009 Regis Houssin <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,11 +32,25 @@
*/
class mailing_pomme extends MailingTargets
{
public $name = 'DolibarrUsers'; // Identifiant du module mailing
// This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
public $desc = 'Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouv�e
public $require_module = array(); // Module mailing actif si modules require_module actifs
public $require_admin = 1; // Module mailing actif pour user admin ou non
/**
* @var string name of mailing module
*/
public $name = 'DolibarrUsers';

/**
* @var string This label is used if no translation is found for key XXX neither MailingModuleDescXXX where XXX=name is found
*/
public $desc = 'Dolibarr users with emails'; // Libelle utilise si aucune traduction pour MailingModuleDescXXX ou XXX=name trouvée

/**
* @var string[] Module mailing actif si modules require_module actifs
*/
public $require_module = array();

/**
* @var int Module mailing actif pour user admin ou non
*/
public $require_admin = 1;

/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
Expand Down
Loading
Loading