mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Use same visual picto everywhere for nature of thirdparty
This commit is contained in:
parent
482ad20a4d
commit
67df1e1b94
|
|
@ -273,9 +273,9 @@ if ($object->id > 0)
|
|||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Prospect/Customer
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ProspectCustomer').'</td><td>';
|
||||
print $object->getLibCustProspStatut();
|
||||
// Type Prospect/Customer/Supplier
|
||||
print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
|
||||
print $object->getTypeUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Prefix
|
||||
|
|
|
|||
|
|
@ -179,6 +179,11 @@ if ($object->id > 0)
|
|||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
// Type Prospect/Customer/Supplier
|
||||
print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
|
||||
print $object->getTypeUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
|
|
|
|||
|
|
@ -2398,19 +2398,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
// Prospect/Customer
|
||||
print '<tr><td class="titlefield">'.$langs->trans('ProspectCustomer').'</td><td>';
|
||||
print $object->getLibCustProspStatut();
|
||||
// Type Prospect/Customer/Supplier
|
||||
print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
|
||||
print $object->getTypeUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Supplier
|
||||
if (!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Supplier').'</td><td>';
|
||||
print yn($object->fournisseur);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Prefix
|
||||
if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,6 +126,33 @@ class Societe extends CommonObject
|
|||
*/
|
||||
public $restrictiononfksoc = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200'
|
||||
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arraykeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
|
|
@ -152,17 +179,8 @@ class Societe extends CommonObject
|
|||
'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110),
|
||||
'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115),
|
||||
'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120),
|
||||
/*'skype' =>array('type'=>'varchar(255)', 'label'=>'Skype', 'enabled'=>1, 'visible'=>-1, 'position'=>125),
|
||||
'whatsapp' =>array('type'=>'varchar(255)', 'label'=>'Whatsapp', 'enabled'=>1, 'visible'=>-1, 'position'=>130),
|
||||
'linkedin' =>array('type'=>'varchar(255)', 'label'=>'Linkedin', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
|
||||
'youtube' =>array('type'=>'varchar(255)', 'label'=>'Youtube', 'enabled'=>1, 'visible'=>-1, 'position'=>140),
|
||||
'googleplus' =>array('type'=>'varchar(255)', 'label'=>'Googleplus', 'enabled'=>1, 'visible'=>-1, 'position'=>145),
|
||||
'snapchat' =>array('type'=>'varchar(255)', 'label'=>'Snapchat', 'enabled'=>1, 'visible'=>-1, 'position'=>150),
|
||||
'instagram' =>array('type'=>'varchar(255)', 'label'=>'Instagram', 'enabled'=>1, 'visible'=>-1, 'position'=>155),
|
||||
'facebook' =>array('type'=>'varchar(255)', 'label'=>'Facebook', 'enabled'=>1, 'visible'=>-1, 'position'=>160),
|
||||
'twitter' =>array('type'=>'varchar(255)', 'label'=>'Twitter', 'enabled'=>1, 'visible'=>-1, 'position'=>165),*/
|
||||
'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170),
|
||||
'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175),
|
||||
'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'),
|
||||
'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180),
|
||||
'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185),
|
||||
'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190),
|
||||
|
|
@ -2589,6 +2607,41 @@ class Societe extends CommonObject
|
|||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return link(s) on type of thirdparty (with picto)
|
||||
*
|
||||
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
|
||||
* @param string $option ''=All
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getTypeUrl($withpicto = 0, $option = '', $notooltip = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$s = '';
|
||||
if (empty($option) || preg_match('/prospect/', $option)) {
|
||||
if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||
{
|
||||
$s .= '<a class="customer-back opacitymedium" title="'.$langs->trans("Prospect").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'">'.dol_substr($langs->trans("Prospect"), 0, 1).'</a>';
|
||||
}
|
||||
}
|
||||
if (empty($option) || preg_match('/customer/', $option)) {
|
||||
if (($this->client == 1 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||
{
|
||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$this->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
||||
}
|
||||
}
|
||||
if (empty($option) || preg_match('/supplier/', $option)) {
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $this->fournisseur)
|
||||
{
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$this->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||
}
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return label of status (activity, closed)
|
||||
*
|
||||
|
|
@ -4348,6 +4401,7 @@ class Societe extends CommonObject
|
|||
* Return label of status customer is prospect/customer
|
||||
*
|
||||
* @return string Label
|
||||
* @see getTypeUrl()
|
||||
*/
|
||||
public function getLibCustProspStatut()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -289,21 +289,7 @@ if ($result)
|
|||
print "</td>\n";
|
||||
// Type
|
||||
print '<td class="center">';
|
||||
$obj = $thirdparty_static;
|
||||
$s = '';
|
||||
if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||
{
|
||||
$s .= '<a class="customer-back opacitymedium" title="'.$langs->trans("Prospect").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$thirdparty_static->id.'">'.dol_substr($langs->trans("Prospect"), 0, 1).'</a>';
|
||||
}
|
||||
if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||
{
|
||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$thirdparty_static->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
|
||||
{
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$thirdparty_static->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||
}
|
||||
print $s;
|
||||
print $thirdparty_static->getTypeUrl();
|
||||
print '</td>';
|
||||
// Last modified date
|
||||
print '<td class="right tddate">';
|
||||
|
|
|
|||
|
|
@ -829,7 +829,8 @@ if (!empty($arrayfields['country.code_iso']['checked']))
|
|||
if (!empty($arrayfields['typent.code']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'maxwidth75', 1);
|
||||
// We use showempty=0 here because there is already an unknown value into dictionary.
|
||||
print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), 'minwidth50 maxwidth100', 1);
|
||||
print '</td>';
|
||||
}
|
||||
// Multiprice level
|
||||
|
|
@ -924,7 +925,7 @@ if (!empty($arrayfields['s.tva_intra']['checked']))
|
|||
print '</td>';
|
||||
}
|
||||
|
||||
// Type (customer/prospect/supplier)
|
||||
// Nature (customer/prospect/supplier)
|
||||
if (!empty($arrayfields['customerorsupplier']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||
|
|
@ -996,7 +997,6 @@ print $searchpicto;
|
|||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, "", $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, "", $sortfield, $sortorder);
|
||||
|
|
@ -1012,7 +1012,7 @@ if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre
|
|||
if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'], $_SERVER["PHP_SELF"], "region.nom", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, "", $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['staff.code']['checked'])) print_liste_field_titre($arrayfields['staff.code']['label'], $_SERVER["PHP_SELF"], "staff.code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['s.price_level']['checked'])) print_liste_field_titre($arrayfields['s.price_level']['label'], $_SERVER["PHP_SELF"], "s.price_level", "", $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder);
|
||||
|
|
@ -1266,20 +1266,7 @@ while ($i < min($num, $limit))
|
|||
if (!empty($arrayfields['customerorsupplier']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
$s = '';
|
||||
if (($obj->client == 2 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS))
|
||||
{
|
||||
$s .= '<a class="customer-back opacitymedium" title="'.$langs->trans("Prospect").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Prospect"), 0, 1).'</a>';
|
||||
}
|
||||
if (($obj->client == 1 || $obj->client == 3) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))
|
||||
{
|
||||
$s .= '<a class="customer-back" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Customer"), 0, 1).'</a>';
|
||||
}
|
||||
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $obj->fournisseur)
|
||||
{
|
||||
$s .= '<a class="vendor-back" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$companystatic->id.'">'.dol_substr($langs->trans("Supplier"), 0, 1).'</a>';
|
||||
}
|
||||
print $s;
|
||||
print $companystatic->getTypeUrl(1);
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user