Skip to content

Commit

Permalink
Use the new banner on all tabs of contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 15, 2015
1 parent 8a32041 commit b43047b
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 71 deletions.
4 changes: 3 additions & 1 deletion htdocs/contact/card.php
Expand Up @@ -411,8 +411,10 @@
*/


$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname;
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ContactsAddresses"),$help_url);
llxHeader('', $title, $help_url);

$form = new Form($db);
$formcompany = new FormCompany($db);
Expand Down
27 changes: 16 additions & 11 deletions htdocs/contact/document.php
Expand Up @@ -74,8 +74,10 @@

$form = new Form($db);

$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname;
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader("",$langs->trans("Contact"), $helpurl);
llxHeader('', $title, $helpurl);

if ($object->id)
{
Expand All @@ -93,16 +95,12 @@
$totalsize+=$file['size'];
}

print '<table class="border" width="100%">';

// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';

// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');

print '<div class="fichecenter">';

print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';

// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
Expand All @@ -123,12 +121,19 @@
}
}

// Civility
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';

print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
print '</table>';

print '</div>';

dol_fiche_end();

$modulepart = 'contact';
$permission = $user->rights->societe->contact->creer;
$param = '&id=' . $object->id;
Expand Down
49 changes: 23 additions & 26 deletions htdocs/contact/ldap.php
Expand Up @@ -39,10 +39,10 @@
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');

$contact = new Contact($db);
$object = new Contact($db);
if ($id > 0)
{
$contact->fetch($id, $user);
$object->fetch($id, $user);
}


Expand All @@ -57,8 +57,8 @@
$ldap=new Ldap();
$result=$ldap->connect_bind();

$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info);
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$olddn=$dn; // We can say that old dn = dn as we force synchro

$result=$ldap->update($dn,$info,$user,$olddn);
Expand Down Expand Up @@ -86,40 +86,35 @@

$form = new Form($db);

$head = contact_prepare_head($contact);
$head = contact_prepare_head($object);

dol_fiche_head($head, 'ldap', $title, 0, 'contact');

dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');

print '<div class="fichecenter">';

print '<table class="border" width="100%">';

// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($contact,'id');
print '</td></tr>';

// Name
print '<tr><td>'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td>'.$contact->lastname.'</td>';
print '<td>'.$langs->trans("Firstname").'</td><td width="25%">'.$contact->firstname.'</td></tr>';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';

// Company
if ($contact->socid > 0)
if ($object->socid > 0)
{
$objsoc = new Societe($db);
$objsoc->fetch($contact->socid);
$thirdparty = new Societe($db);
$thirdparty->fetch($object->socid);

print '<tr><td width="20%">'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$objsoc->getNomUrl(1).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td colspan="3">'.$thirdparty->getNomUrl(1).'</td></tr>';
}
else
{
print '<tr><td width="20%">'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td colspan="3">';
print $langs->trans("ContactNotLinkedToCompany");
print '</td></tr>';
}

// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $contact->getCivilityLabel();
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';

// LDAP DN
Expand All @@ -135,6 +130,8 @@

print '</table>';

print '</div>';

dol_fiche_end();


Expand All @@ -146,7 +143,7 @@

if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr')
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$contact->id.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a>';
}

print "</div>\n";
Expand All @@ -170,9 +167,9 @@
$result=$ldap->connect_bind();
if ($result > 0)
{
$info=$contact->_load_ldap_info();
$dn=$contact->_load_ldap_dn($info,1);
$search = "(".$contact->_load_ldap_dn($info,2).")";
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info,1);
$search = "(".$object->_load_ldap_dn($info,2).")";
$records=$ldap->getAttribute($dn,$search);

//var_dump($records);
Expand Down
30 changes: 16 additions & 14 deletions htdocs/contact/note.php
Expand Up @@ -55,12 +55,14 @@
* View
*/

$now=dol_now();

$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));

$form = new Form($db);

$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$title,$help_url);
llxHeader('', $title, $help_url);

if ($id > 0)
{
Expand All @@ -77,18 +79,16 @@
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

print '<table class="border" width="100%">';


$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');

print '<div class="fichecenter">';

print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';

// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';

// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';

// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
Expand All @@ -110,7 +110,7 @@
}

// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';

Expand All @@ -120,7 +120,7 @@
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");
print '<td class="titlefield">'.$langs->trans("DateToBirth").'</td><td colspan="3">'.dol_print_date($object->birthday,"day");

print ' &nbsp; ';
//var_dump($birthdatearray);
Expand All @@ -144,9 +144,11 @@

print "</table>";

print '<div>';

print '<br>';

$colwidth='20';
$cssclass='titlefield';
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';


Expand Down
32 changes: 15 additions & 17 deletions htdocs/contact/perso.php
Expand Up @@ -70,8 +70,9 @@
$now=dol_now();

$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));

llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas');
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname;
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $title, $helpurl);

$form = new Form($db);

Expand Down Expand Up @@ -155,21 +156,17 @@
}
else
{
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';

// View mode

$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';

// Ref
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td></tr>';

// Name
print '<tr><td width="20%">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</td><td width="30%">'.$object->lastname.'</td>';
print '<td width="20%">'.$langs->trans("Firstname").'</td><td width="30%">'.$object->firstname.'</td></tr>';

dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');


print '<div class="fichecenter">';

print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';

// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
Expand All @@ -191,7 +188,7 @@
}

// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td colspan="3">';
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
print '</td></tr>';

Expand Down Expand Up @@ -225,6 +222,7 @@

print "</table>";

print '</div>';
}

dol_fiche_end();
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/notes.tpl.php
Expand Up @@ -50,7 +50,7 @@

// Special cases
if ($module == 'propal') { $permission=$user->rights->propale->creer;}
elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;}
elseif ($module == 'askpricesupplier') { $permission=$user->rights->askpricesupplier->creer;}
elseif ($module == 'fichinter') { $permission=$user->rights->ficheinter->creer;}
elseif ($module == 'project') { $permission=$user->rights->projet->creer;}
elseif ($module == 'project_task') { $permission=$user->rights->projet->creer;}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/theme/eldy/style.css.php
Expand Up @@ -2026,7 +2026,7 @@
border-bottom-color: #BBB;
border-bottom-style: solid;

margin: 0px 0px 2px 0px;
margin: 0px 0px 5px 0px;

-moz-box-shadow: 2px 2px 4px #CCC;
-webkit-box-shadow: 2px 2px 4px #CCC;
Expand Down

0 comments on commit b43047b

Please sign in to comment.