Fix: uniformize code

This commit is contained in:
Regis Houssin 2011-01-15 13:00:36 +00:00
parent a1df2c357b
commit 22a0045a74
3 changed files with 10 additions and 10 deletions

View File

@ -99,18 +99,18 @@ class ActionsContactCardCommon
if ($objsoc->typent_code == 'TE_PRIVATE') if ($objsoc->typent_code == 'TE_PRIVATE')
{ {
if (dol_strlen(trim($this->object->address)) == 0) $this->tpl['address'] = $objsoc->address; if (dol_strlen(trim($this->object->address)) == 0) $this->tpl['address'] = $objsoc->address;
if (dol_strlen(trim($this->object->zip)) == 0) $this->object->zip = $objsoc->cp; if (dol_strlen(trim($this->object->zip)) == 0) $this->object->zip = $objsoc->zip;
if (dol_strlen(trim($this->object->town)) == 0) $this->object->town = $objsoc->ville; if (dol_strlen(trim($this->object->town)) == 0) $this->object->town = $objsoc->town;
if (dol_strlen(trim($this->object->phone_pro)) == 0) $this->object->phone_pro = $objsoc->tel; if (dol_strlen(trim($this->object->phone_pro)) == 0) $this->object->phone_pro = $objsoc->phone;
if (dol_strlen(trim($this->object->fax)) == 0) $this->object->fax = $objsoc->fax; if (dol_strlen(trim($this->object->fax)) == 0) $this->object->fax = $objsoc->fax;
if (dol_strlen(trim($this->object->email)) == 0) $this->object->email = $objsoc->email; if (dol_strlen(trim($this->object->email)) == 0) $this->object->email = $objsoc->email;
} }
// Zip // Zip
$this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->cp,'zipcode',array('town','selectpays_id','departement_id'),6); $this->tpl['select_zip'] = $formcompany->select_ziptown($this->object->zip,'zipcode',array('town','selectpays_id','departement_id'),6);
// Town // Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->ville,'town',array('zipcode','selectpays_id','departement_id')); $this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town,'town',array('zipcode','selectpays_id','departement_id'));
if (dol_strlen(trim($this->object->fk_pays)) == 0) $this->object->fk_pays = $objsoc->pays_id; if (dol_strlen(trim($this->object->fk_pays)) == 0) $this->object->fk_pays = $objsoc->pays_id;
@ -212,7 +212,7 @@ class ActionsContactCardCommon
$this->tpl['address'] = dol_nl2br($this->object->address); $this->tpl['address'] = dol_nl2br($this->object->address);
$this->tpl['zip'] = ($this->object->cp?$this->object->cp.' ':''); $this->tpl['zip'] = ($this->object->zip?$this->object->zip.' ':'');
$img=picto_from_langcode($this->object->pays_code); $img=picto_from_langcode($this->object->pays_code);
$this->tpl['country'] = ($img?$img.' ':'').$this->object->pays; $this->tpl['country'] = ($img?$img.' ':'').$this->object->pays;

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -243,7 +243,7 @@ function CheckVAT(a) {
<?php } ?> <?php } ?>
<?php if ($user->rights->societe->contact->creer) { ?> <?php if ($user->rights->societe->contact->creer) { ?>
<a class="butAction" href="<?php echo DOL_URL_ROOT.'/contact/fiche.php?socid='.$this->control->tpl['id'].'&amp;action=create&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("AddContact"); ?></a> <a class="butAction" href="<?php echo DOL_URL_ROOT.'/contact/fiche.php?socid='.$this->control->tpl['id'].'&amp;action=create&amp;canvas=default'; ?>"><?php echo $langs->trans("AddContact"); ?></a>
<?php } ?> <?php } ?>
<?php if ($user->rights->societe->supprimer) { ?> <?php if ($user->rights->societe->supprimer) { ?>

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr> /* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
* *
* 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
@ -176,7 +176,7 @@
<?php } ?> <?php } ?>
<?php if ($user->rights->societe->contact->creer) { ?> <?php if ($user->rights->societe->contact->creer) { ?>
<a class="butAction" href="<?php echo DOL_URL_ROOT.'/contact/fiche.php?socid='.$this->control->tpl['id'].'&amp;action=create&amp;canvas='.$canvas; ?>"><?php echo $langs->trans("AddContact"); ?></a> <a class="butAction" href="<?php echo DOL_URL_ROOT.'/contact/fiche.php?socid='.$this->control->tpl['id'].'&amp;action=create&amp;canvas=default'; ?>"><?php echo $langs->trans("AddContact"); ?></a>
<?php } ?> <?php } ?>
<?php if ($user->rights->societe->supprimer) { ?> <?php if ($user->rights->societe->supprimer) { ?>