NEW On page to see/edit contact of an ojbect, the status of contact is
visible (for both external and internal users).
This commit is contained in:
parent
f35c41cc7e
commit
6f5a30638c
@ -812,7 +812,7 @@ else
|
|||||||
// Statut
|
// Statut
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $object->getLibStatut(5);
|
print $object->getLibStatut(4);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
@ -1036,7 +1036,7 @@ else
|
|||||||
// Statut
|
// Statut
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td>';
|
print '<tr><td>'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $object->getLibStatut(5);
|
print $object->getLibStatut(4);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
// Other attributes
|
// Other attributes
|
||||||
|
|||||||
@ -970,7 +970,7 @@ class Contact extends CommonObject
|
|||||||
}
|
}
|
||||||
elseif ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft');
|
if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
}
|
}
|
||||||
elseif ($mode == 5)
|
elseif ($mode == 5)
|
||||||
|
|||||||
@ -418,7 +418,7 @@ abstract class CommonObject
|
|||||||
/**
|
/**
|
||||||
* Get array of all contacts for an object
|
* Get array of all contacts for an object
|
||||||
*
|
*
|
||||||
* @param int $statut Status of lines to get (-1=all)
|
* @param int $statut Status of links to get (-1=all)
|
||||||
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
|
||||||
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
|
||||||
* @return array Array of contacts
|
* @return array Array of contacts
|
||||||
@ -429,9 +429,9 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$tab=array();
|
$tab=array();
|
||||||
|
|
||||||
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
|
$sql = "SELECT ec.rowid, ec.statut as statuslink, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user
|
||||||
if ($source == 'internal') $sql.=", '-1' as socid";
|
if ($source == 'internal') $sql.=", '-1' as socid, t.statut as statuscontact";
|
||||||
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
|
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid, t.statut as statuscontact";
|
||||||
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
|
$sql.= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email";
|
||||||
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
|
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
|
||||||
@ -463,8 +463,8 @@ abstract class CommonObject
|
|||||||
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||||
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
|
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
|
||||||
'nom'=>$obj->lastname, // For backward compatibility
|
'nom'=>$obj->lastname, // For backward compatibility
|
||||||
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email,
|
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email, 'statuscontact'=>$obj->statuscontact,
|
||||||
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut, 'fk_c_type_contact' => $obj->fk_c_type_contact);
|
'rowid'=>$obj->rowid, 'code'=>$obj->code, 'libelle'=>$libelle_type, 'status'=>$obj->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -164,6 +164,8 @@ $userstatic=new User($db);
|
|||||||
</div>
|
</div>
|
||||||
<div class="tagtd">
|
<div class="tagtd">
|
||||||
<?php
|
<?php
|
||||||
|
$statusofcontact = $tab[$i]['status'];
|
||||||
|
|
||||||
if ($tab[$i]['source']=='internal')
|
if ($tab[$i]['source']=='internal')
|
||||||
{
|
{
|
||||||
$userstatic->id=$tab[$i]['id'];
|
$userstatic->id=$tab[$i]['id'];
|
||||||
@ -182,24 +184,24 @@ $userstatic=new User($db);
|
|||||||
</div>
|
</div>
|
||||||
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
|
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
|
||||||
<div class="tagtd" align="center">
|
<div class="tagtd" align="center">
|
||||||
<?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?>
|
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=swapstatut&ligne='.$tab[$i]['rowid'].'">'; ?>
|
||||||
<?php
|
<?php
|
||||||
if ($tab[$i]['source']=='internal')
|
if ($tab[$i]['source']=='internal')
|
||||||
{
|
{
|
||||||
$userstatic->id=$tab[$i]['id'];
|
$userstatic->id=$tab[$i]['id'];
|
||||||
$userstatic->lastname=$tab[$i]['lastname'];
|
$userstatic->lastname=$tab[$i]['lastname'];
|
||||||
$userstatic->firstname=$tab[$i]['firstname'];
|
$userstatic->firstname=$tab[$i]['firstname'];
|
||||||
//echo $userstatic->LibStatut($tab[$i]['status'],3);
|
echo $userstatic->LibStatut($tab[$i]['statuscontact'],3);
|
||||||
}
|
}
|
||||||
if ($tab[$i]['source']=='external')
|
if ($tab[$i]['source']=='external')
|
||||||
{
|
{
|
||||||
$contactstatic->id=$tab[$i]['id'];
|
$contactstatic->id=$tab[$i]['id'];
|
||||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||||
echo $contactstatic->LibStatut($tab[$i]['status'],3);
|
echo $contactstatic->LibStatut($tab[$i]['statuscontact'],3);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php if ($object->statut >= 0) echo '</a>'; ?>
|
<?php //if ($object->statut >= 0) echo '</a>'; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="tagtd nowrap" align="right">
|
<div class="tagtd nowrap" align="right">
|
||||||
<?php if ($permission) { ?>
|
<?php if ($permission) { ?>
|
||||||
|
|||||||
@ -1012,7 +1012,7 @@ else
|
|||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
|
print '<tr><td valign="top"><label for="address">'.$langs->trans('Address').'</label></td>';
|
||||||
print '<td colspan="3"><textarea name="address" id="address" cols="40" rows="3" wrap="soft">';
|
print '<td colspan="3"><textarea name="address" id="address" cols="80" rows="'._ROWS_2.'" wrap="soft">';
|
||||||
print $object->address;
|
print $object->address;
|
||||||
print '</textarea></td></tr>';
|
print '</textarea></td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -261,6 +261,11 @@ input, textarea, select {
|
|||||||
margin-bottom:1px;
|
margin-bottom:1px;
|
||||||
margin-top:1px;
|
margin-top:1px;
|
||||||
}
|
}
|
||||||
|
input.removedassigned {
|
||||||
|
padding: 2px !important;
|
||||||
|
vertical-align: text-bottom;
|
||||||
|
margin-bottom: -3px;
|
||||||
|
}
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
select.flat, form.flat select {
|
select.flat, form.flat select {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user