2
0
forked from Wavyzz/dolibarr

Use the new card banner for members

This commit is contained in:
Laurent Destailleur
2015-10-16 16:14:33 +02:00
parent ebdc402832
commit df0c6aa5cf
7 changed files with 97 additions and 129 deletions

View File

@@ -84,16 +84,14 @@ if ($object->id > 0)
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))
@@ -101,6 +99,9 @@ if ($object->id > 0)
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%">';
@@ -108,9 +109,6 @@ if ($object->id > 0)
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>';
@@ -132,6 +130,8 @@ if ($object->id > 0)
print '</div>';
dol_fiche_end();
/*
* Barre d'action

View File

@@ -802,13 +802,6 @@ else
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();
@@ -820,6 +813,13 @@ else
}
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>';
@@ -1050,7 +1050,7 @@ else
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>';
@@ -1402,37 +1402,29 @@ else
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>';
dol_banner_tab($object, 'rowid', $linkback);
$showphoto='<td rowspan="'.$rowspan.'" align="center" class="hideonsmartphone" valign="middle" width="25%">';
$showphoto.=$form->showphoto('memberphoto',$object);
$showphoto.='</td>';
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>';
}
// 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";
// Morphy
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
print '</tr>';
// Company
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
@@ -1447,9 +1439,6 @@ else
// 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))
{
@@ -1463,48 +1452,26 @@ else
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))
{
@@ -1594,12 +1561,16 @@ else
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

View File

@@ -567,34 +567,31 @@ if ($rowid > 0)
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>';
dol_banner_tab($object, 'rowid', $linkback);
$showphoto='<td rowspan="'.$rowspan.'" class="hideonsmartphone" align="center" valign="middle" width="25%">'.$form->showphoto('memberphoto',$object).'</td>';
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>';
@@ -701,14 +698,13 @@ if ($rowid > 0)
print "</table>\n";
print '</div>';
dol_fiche_end();
print '</form>';
dol_htmloutput_errors($errmsg,$errmsgs);
/*
* Hotbar
*/

View File

@@ -447,18 +447,18 @@ abstract class CommonObject
$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;
@@ -489,40 +489,40 @@ abstract class CommonObject
$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++;

View File

@@ -732,6 +732,7 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi
$limittoshow=(empty($conf->global->MAIN_MAXTABS_IN_CARD)?99:$conf->global->MAIN_MAXTABS_IN_CARD);
$displaytab=0;
$nbintab=0;
$popuptab=0;
for ($i = 0 ; $i <= $maxkey ; $i++)
{
@@ -1497,7 +1498,7 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
* Format phone numbers according to country
*
* @param string $phone Phone number to format
* @param string $country Country code to use for formatting
* @param string $countrycode Country code to use for formatting
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set)
@@ -1506,20 +1507,20 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
* @param string $titlealt Text to show on alt
* @return string Formated phone number
*/
function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="&nbsp;",$withpicto='',$titlealt='')
function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$separ="&nbsp;",$withpicto='',$titlealt='')
{
global $conf,$user,$langs,$mysoc;
// Clean phone parameter
$phone = preg_replace("/[\s.-]/","",trim($phone));
if (empty($phone)) { return ''; }
if (empty($country)) $country=$mysoc->country_code;
if (empty($countrycode)) $countrycode=$mysoc->country_code;
// Short format for small screens
if ($conf->dol_optimize_smallscreen) $separ='';
$newphone=$phone;
if (strtoupper($country) == "FR")
if (strtoupper($countrycode) == "FR")
{
// France
if (dol_strlen($phone) == 10) {

View File

@@ -186,13 +186,13 @@ if ($result > 0)
print '</td></tr>';
print '</table>';
// Help
print '<br>'.$langs->trans("NotificationsDesc");
print '</div>';
dol_fiche_end();
// Help
print $langs->trans("NotificationsDesc").'<br><br>';
print "\n";
// Add notification form
@@ -221,12 +221,12 @@ if ($result > 0)
// Load array of available notifications
$notificationtrigger=new InterfaceNotification($db);
$listofnotifiedevents=$notificationtrigger->getListOfManagedEvents();
$listofmanagedeventfornotification=$notificationtrigger->getListOfManagedEvents();
foreach($listofnotifiedevents as $notifiedevent)
foreach($listofmanagedeventfornotification as $managedeventfornotification)
{
$label=($langs->trans("Notify_".$notifiedevent['code'])!="Notify_".$notifiedevent['code']?$langs->trans("Notify_".$notifiedevent['code']):$notifiedevent['label']);
$actions[$notifiedevent['rowid']]=$label;
$label=($langs->trans("Notify_".$managedeventfornotification['code'])!="Notify_".$managedeventfornotification['code']?$langs->trans("Notify_".$managedeventfornotification['code']):$managedeventfornotification['label']);
$actions[$managedeventfornotification['rowid']]=$label;
}
print '<tr '.$bc[$var].'><td>';
print $form->selectarray("contactid",$listofemails);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 675 B