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:
Laurent Destailleur 2015-05-22 12:21:36 +02:00
parent f35c41cc7e
commit 6f5a30638c
6 changed files with 23 additions and 16 deletions

View File

@ -812,7 +812,7 @@ else
// Statut
print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatut(5);
print $object->getLibStatut(4);
print '</td></tr>';
// Other attributes
@ -1036,7 +1036,7 @@ else
// Statut
print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td>';
print $object->getLibStatut(5);
print $object->getLibStatut(4);
print '</td>';
print '</tr>'."\n";
// Other attributes

View File

@ -970,7 +970,7 @@ class Contact extends CommonObject
}
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 ($mode == 5)

View File

@ -418,7 +418,7 @@ abstract class CommonObject
/**
* 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 int $list 0:Return array contains all properties, 1:Return array contains just id
* @return array Array of contacts
@ -429,9 +429,9 @@ abstract class CommonObject
$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
if ($source == 'internal') $sql.=", '-1' as socid";
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
$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, t.statut as statuscontact";
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.= ", tc.source, tc.element, tc.code, tc.libelle";
$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);
$tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
'nom'=>$obj->lastname, // For backward compatibility
'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email,
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut, 'fk_c_type_contact' => $obj->fk_c_type_contact);
'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->statuslink, 'fk_c_type_contact'=>$obj->fk_c_type_contact);
}
else
{

View File

@ -1,6 +1,6 @@
<?php
/* 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
* it under the terms of the GNU General Public License as published by
@ -164,6 +164,8 @@ $userstatic=new User($db);
</div>
<div class="tagtd">
<?php
$statusofcontact = $tab[$i]['status'];
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
@ -182,24 +184,24 @@ $userstatic=new User($db);
</div>
<div class="tagtd"><?php echo $tab[$i]['libelle']; ?></div>
<div class="tagtd" align="center">
<?php if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
<?php //if ($object->statut >= 0) echo '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=swapstatut&amp;ligne='.$tab[$i]['rowid'].'">'; ?>
<?php
if ($tab[$i]['source']=='internal')
{
$userstatic->id=$tab[$i]['id'];
$userstatic->lastname=$tab[$i]['lastname'];
$userstatic->firstname=$tab[$i]['firstname'];
//echo $userstatic->LibStatut($tab[$i]['status'],3);
echo $userstatic->LibStatut($tab[$i]['statuscontact'],3);
}
if ($tab[$i]['source']=='external')
{
$contactstatic->id=$tab[$i]['id'];
$contactstatic->lastname=$tab[$i]['lastname'];
$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 class="tagtd nowrap" align="right">
<?php if ($permission) { ?>

View File

@ -1012,7 +1012,7 @@ else
// Address
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 '</textarea></td></tr>';
@ -2259,7 +2259,7 @@ else
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="soc.php?action=merge&socid='.$object->id.'" title="'.dol_escape_htmltag($langs->trans("MergeThirdparties")).'">'.$langs->trans('Merge').'</a></div>';
}
if ($user->rights->societe->supprimer)
{
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile

View File

@ -261,6 +261,11 @@ input, textarea, select {
margin-bottom:1px;
margin-top:1px;
}
input.removedassigned {
padding: 2px !important;
vertical-align: text-bottom;
margin-bottom: -3px;
}
<?php } ?>
select.flat, form.flat select {