diff --git a/ChangeLog_Koesio.md b/ChangeLog_Koesio.md index bfdd1b6068945..c9130ca396df9 100644 --- a/ChangeLog_Koesio.md +++ b/ChangeLog_Koesio.md @@ -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 diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3ccb2284a9940..191f7db29b521 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2022 Frédéric France + * Copyright (C) 2015-2023 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2018-2019 Thibault FOUCART @@ -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 @@ -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; @@ -284,6 +300,10 @@ class Adherent extends CommonObject public $subscriptions = array(); + /** + * @var string ip + */ + public $ip; // Fields loaded by fetchPartnerships() from partnership table diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 30616cdc8837e..5437e2ee95050 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -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(); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d27976c71bb37..5513becc36924 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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 @@ -142,6 +152,11 @@ class Contact extends CommonObject */ public $gender; + /** + * @var string fullname + */ + public $fullname; + /** * @var string Address */ @@ -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 @@ -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); } /** @@ -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 = '
'; + $return .= '
'; + $return .= ''; + //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 .= ''; + $return .= '
'; + $return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'
'; + + if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) { + $return .= '
'.$this->thirdparty->getNomUrl(1).'
'; + } + /*if (property_exists($this, 'phone_pro') && !empty($this->phone_pro)) { + $return .= '
'.img_picto($langs->trans("Phone"), 'phone'); + $return .= ' '.$this->phone_pro.''; + }*/ + /*if (method_exists($this, 'LibPubPriv')) { + $return .= '
'.$langs->trans("Visibility").''; + $return .= ' : '.$this->LibPubPriv($this->priv).''; + }*/ + if (method_exists($this, 'getLibStatut')) { + $return .= '
'.$this->getLibStatut(5).'
'; + } + $return .= '
'; + $return .= '
'; + $return .= '
'; + return $return; + } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a85fbb38bd43e..4f0855676781b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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. diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index c7feb5d408e6d..c811e322a732b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -78,6 +78,11 @@ class User extends CommonObject public $employee; public $civility_code; + /** + * @var string fullname + */ + public $fullname; + /** * @var string gender */