Skip to content

Commit

Permalink
fix undeclared properties for php 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic34 authored and atm-irvine committed Jan 30, 2025
1 parent f7e1f61 commit aeb03e1
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 8 deletions.
7 changes: 7 additions & 0 deletions htdocs/adherents/class/adherent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ class Adherent extends CommonObject
*/
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
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;
}
}
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

0 comments on commit aeb03e1

Please sign in to comment.