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

Fix undeclared properties backport #565

Open
wants to merge 3 commits into
base: 17.0_koesio
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions ChangeLog_Koesio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Backported from 17.0 :
- Backport develop PR #23625 : Undeclared properties
- Backport develop PR #32662 : New hooks in services_list and added global search
- Backport 17.0 PR #32654 : Search thirdparty in services list
- Backport develop PR #32129 : New field rule for lines dates
Expand Down
22 changes: 21 additions & 1 deletion htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Copyright (C) 2009-2017 Regis Houssin <[email protected]>
* Copyright (C) 2014-2018 Alexandre Spangaro <[email protected]>
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2015-2022 Frédéric France <[email protected]>
* Copyright (C) 2015-2023 Frédéric France <[email protected]>
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]>
* Copyright (C) 2016 Juanjo Menent <[email protected]>
* Copyright (C) 2018-2019 Thibault FOUCART <[email protected]>
Expand Down Expand Up @@ -89,6 +89,18 @@ class Adherent extends CommonObject
*/
public $pass_indatabase_crypted;

/**
* @var string fullname
*/
public $fullname;

/**
* @var string The civility code, not an integer
*/
public $civility_id;
public $civility_code;
public $civility;

/**
* @var string company name
* @deprecated
Expand Down Expand Up @@ -272,6 +284,10 @@ class Adherent extends CommonObject

public $first_subscription_date;

public $first_subscription_date_start;

public $first_subscription_date_end;

public $first_subscription_amount;

public $last_subscription_date;
Expand All @@ -284,6 +300,10 @@ class Adherent extends CommonObject

public $subscriptions = array();

/**
* @var string ip
*/
public $ip;

// Fields loaded by fetchPartnerships() from partnership table

Expand Down
13 changes: 13 additions & 0 deletions htdocs/adherents/class/adherent_type.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,19 @@ class AdherentType extends CommonObject
/** @var string string other */
public $other = array();

/**
* @var string description
*/
public $description;

/**
* @var string email
*/
public $email;

/**
* @var array multilangs
*/
public $multilangs = array();


Expand Down
74 changes: 66 additions & 8 deletions htdocs/contact/class/contact.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ class Contact extends CommonObject
public $civility_code;
public $civility;

/**
* @var int egroupware_id
*/
public $egroupware_id;

/**
* @var int birthday_alert
*/
public $birthday_alert;

/**
* @var string The civilite code, not an integer
* @deprecated
Expand All @@ -142,6 +152,11 @@ class Contact extends CommonObject
*/
public $gender;

/**
* @var string fullname
*/
public $fullname;

/**
* @var string Address
*/
Expand Down Expand Up @@ -358,9 +373,9 @@ public function __construct($db)
$this->fields['fk_soc']['searchall'] = 0;
}

if (empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) { // Default behaviour
$this->fields['fk_stcommcontact']['enabled'] = 0;
$this->fields['fk_prospectcontactlevel']['enabled'] = 0;
$this->fields['fk_prospectlevel']['enabled'] = 0;
}

// Unset fields that are disabled
Expand Down Expand Up @@ -1719,18 +1734,18 @@ public function setCategories($categories)
/**
* Function used to replace a thirdparty id with another one.
*
* @param DoliDB $db Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
* @param DoliDB $dbs Database handler, because function is static we name it $dbs not $db to avoid breaking coding test
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
* @return bool
*/
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
public static function replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id)
{
$tables = array(
'socpeople', 'societe_contacts'
);

return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables);
}

/**
Expand Down Expand Up @@ -2125,4 +2140,47 @@ public function getNoEmail()
}
return 0;
}


/**
* Return clicable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '')
{
global $langs;
$return = '<div class="box-flex-item box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
//var_dump($this->photo);exit;
if (property_exists($this, 'photo') && !is_null($this->photo)) {
$return.= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
} else {
$return .= img_picto('', $this->picto);
}
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<div class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</div>';

if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
$return .= '<div class="info-box-ref opacitymedium tdoverflowmax150">'.$this->thirdparty->getNomUrl(1).'</div>';
}
/*if (property_exists($this, 'phone_pro') && !empty($this->phone_pro)) {
$return .= '<br>'.img_picto($langs->trans("Phone"), 'phone');
$return .= ' <span class="info-box-label">'.$this->phone_pro.'</span>';
}*/
/*if (method_exists($this, 'LibPubPriv')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Visibility").'</span>';
$return .= '<span> : '.$this->LibPubPriv($this->priv).'</span>';
}*/
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
}
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
return $return;
}
}
9 changes: 9 additions & 0 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,15 @@ abstract class CommonObject
protected $labelStatus;
protected $labelStatusShort;

/**
* @var array nb used in load_stateboard
*/
public $nb = array();

/**
* @var string output
*/
public $output;

/**
* @var array List of child tables. To test if we can delete object.
Expand Down
5 changes: 5 additions & 0 deletions htdocs/user/class/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class User extends CommonObject
public $employee;
public $civility_code;

/**
* @var string fullname
*/
public $fullname;

/**
* @var string gender
*/
Expand Down
Loading