Skip to content

Commit

Permalink
Use the new card banner for members
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 16, 2015
1 parent ebdc402 commit df0c6aa
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 128 deletions.
24 changes: 12 additions & 12 deletions htdocs/adherents/agenda.php
Expand Up @@ -84,33 +84,31 @@

dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user');

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

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

// Reference
print '<tr><td width="20%">'.$langs->trans('Ref').'</td>';
print '<td colspan="3">';
print $form->showrefnav($object, 'id', $linkback);
print '</td>';
print '</tr>';
dol_banner_tab($object, 'rowid', $linkback);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';

// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
}

// Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
/*print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
print $form->showphoto('memberphoto',$member);
print '</td>';*/
print '</tr>';

// Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';

Expand All @@ -132,6 +130,8 @@

print '</div>';

dol_fiche_end();


/*
* Barre d'action
Expand Down
97 changes: 34 additions & 63 deletions htdocs/adherents/card.php
Expand Up @@ -802,13 +802,6 @@ function initfieldrequired()
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" size="40" value="'.(isset($_POST["member_login"])?$_POST["member_login"]:$object->login).'"></td></tr>';
}

// Moral-Physique
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td class="fieldrequired">'.$langs->trans("Nature")."</td><td>\n";
print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1);
print "</td>\n";

// Type
print '<tr><td class="fieldrequired">'.$langs->trans("MemberType").'</td><td>';
$listetype=$adht->liste_array();
Expand All @@ -820,6 +813,13 @@ function initfieldrequired()
}
print "</td>\n";

// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td class="fieldrequired">'.$langs->trans("Nature")."</td><td>\n";
print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1);
print "</td>\n";

// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(GETPOST('societe','alpha')?GETPOST('societe','alpha'):$object->societe).'"></td></tr>';

Expand Down Expand Up @@ -1050,7 +1050,7 @@ function initfieldrequired()
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" size="30" value="'.(isset($_POST["login"])?$_POST["login"]:$object->login).'"></td></tr>';
}

// Physique-Moral
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>';
Expand Down Expand Up @@ -1402,37 +1402,29 @@ function initfieldrequired()
if (! empty($conf->societe->enabled)) $rowspan++;
if (! empty($conf->skype->enabled)) $rowspan++;

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

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

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

$showphoto='<td rowspan="'.$rowspan.'" align="center" class="hideonsmartphone" valign="middle" width="25%">';
$showphoto.=$form->showphoto('memberphoto',$object);
$showphoto.='</td>';

dol_banner_tab($object, 'rowid', $linkback);

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

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

// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td>';
// Photo
print $showphoto; $showphoto='';
print '</tr>';
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td></tr>';
}

// Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print $showphoto; $showphoto='';
print '</tr>';

// Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';

Expand All @@ -1447,9 +1439,6 @@ function initfieldrequired()
// Firstname
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td></tr>';

// EMail
print '<tr><td>'.$langs->trans("EMail").'</td><td class="valeur">'.dol_print_email($object->email,0,$object->fk_soc,1).'</td></tr>';

// Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
Expand All @@ -1463,48 +1452,26 @@ function initfieldrequired()
print '</td></tr>';
}

// Address
print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">';
dol_print_address($object->address,'gmap','member',$object->id);
print '</td></tr>';

// Zip / Town
print '<tr><td class="nowrap">'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'</td></tr>';

// Country
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">';
$img=picto_from_langcode($object->country_code);
if ($img) print $img.' ';
print getCountry($object->country_code);
print '</td></tr>';

// State
print '<tr><td>'.$langs->trans('State').'</td><td class="valeur">'.$object->state.'</td>';

// Tel pro.
print '<tr><td>'.$langs->trans("PhonePro").'</td><td class="valeur">'.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).'</td></tr>';

// Tel perso
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td class="valeur">'.dol_print_phone($object->phone_perso,$object->country_code,0,$object->fk_soc,1).'</td></tr>';

// Tel mobile
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td class="valeur">'.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'</td></tr>';

// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
}

print '</table>';

print '</div>';
print '<div class="fichehalfright"><div class="ficheaddleft">';

print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">';

// Birthday
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';

// Public
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';

// Status
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$object->getLibStatut(4).'</td></tr>';

// Categories
if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire))
{
Expand Down Expand Up @@ -1594,12 +1561,16 @@ function initfieldrequired()

print "</table>\n";

print "</div>\n";

print "</div></div></div>\n";
print '<div style="clear:both"></div>';

dol_fiche_end();


/*
* Hotbar
*/

print '<div class="tabsAction">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
Expand Down
30 changes: 13 additions & 17 deletions htdocs/adherents/card_subscriptions.php
Expand Up @@ -567,34 +567,31 @@

dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user');

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

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

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

$showphoto='<td rowspan="'.$rowspan.'" class="hideonsmartphone" align="center" valign="middle" width="25%">'.$form->showphoto('memberphoto',$object).'</td>';

dol_banner_tab($object, 'rowid', $linkback);

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

print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">';

// Login
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
{
print '<tr><td>'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td>';
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.'&nbsp;</td>';
print $showphoto; $showphoto='';
print '</tr>';
}

// Type
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print $showphoto; $showphoto='';
print '</tr>';

// Type
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";

// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';

Expand Down Expand Up @@ -701,14 +698,13 @@

print "</table>\n";

print '</div>';

dol_fiche_end();

print '</form>';


dol_htmloutput_errors($errmsg,$errmsgs);


/*
* Hotbar
*/
Expand Down
32 changes: 16 additions & 16 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -447,18 +447,18 @@ function getBannerAddress($htmlkey, $object)

$countriesusingstate=array('AU','US','IN','GB','ES','UK','TR');

$contacti=0;
$contactid=0;
$thirdpartyid=0;
if ($this->elemet == 'societe')
if ($this->element == 'societe')
{
$thirdpartyid=$this->id;
}
if ($this->elemet == 'contact')
if ($this->element == 'contact')
{
$contactid=$this->id;
$thirdpartyid=$object->fk_soc;
}
if ($this->elemet == 'user')
if ($this->element == 'user')
{
$contactid=$this->contact_id;
$thirdpartyid=$object->fk_soc;
Expand Down Expand Up @@ -489,40 +489,40 @@ function getBannerAddress($htmlkey, $object)
$outdone++;
}

if ($this->phone_pro || $this->phone_mobile || $this->phone_perso || $this->fax || $this->office_phone || $this->user_mobile || $this->office_fax) $out.=($outdone?'<br>':'');
if ($this->phone && empty($this->phone_pro)) { // For objects that store pro phone into ->phone
$out.=dol_print_phone($this->phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
if (! empty($this->phone_pro) || ! empty($this->phone_mobile) || ! empty($this->phone_perso) || ! empty($this->fax) || ! empty($this->office_phone) || ! empty($this->user_mobile) || ! empty($this->office_fax)) $out.=($outdone?'<br>':'');
if (! empty($this->phone) && empty($this->phone_pro)) { // For objects that store pro phone into ->phone
$out.=dol_print_phone($this->phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->phone_pro)) {
$out.=dol_print_phone($this->phone_pro,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
$out.=dol_print_phone($this->phone_pro,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->phone_mobile)) {
$out.=dol_print_phone($this->phone_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
$out.=dol_print_phone($this->phone_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
}
if (! empty($this->phone_perso)) {
$out.=dol_print_phone($this->phone_perso,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePerso")); $outdone++;
$out.=dol_print_phone($this->phone_perso,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePerso")); $outdone++;
}
if (! empty($this->fax)) {
$out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
$out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
}
if (! empty($this->office_phone)) {
$out.=dol_print_phone($this->office_phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
$out.=dol_print_phone($this->office_phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhonePro")); $outdone++;
}
if (! empty($this->user_mobile)) {
$out.=dol_print_phone($this->user_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
$out.=dol_print_phone($this->user_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL','&nbsp;','phone',$langs->trans("PhoneMobile")); $outdone++;
}
if (! empty($this->office_fax)) {
$out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
$out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX','&nbsp;','fax',$langs->trans("Fax")); $outdone++;
}

$out.='<div style="clear: both;"></div>';
$outdone=0;
if ($this->email)
if (! empty($this->email))
{
$out.=dol_print_email($this->email,$this->id,$object->id,'AC_EMAIL',0,0,1);
$outdone++;
}
if ($this->url)
if (! empty($this->url))
{
$out.=dol_print_url($this->url,'',0,1);
$outdone++;
Expand Down

0 comments on commit df0c6aa

Please sign in to comment.