From df0c6aa5cf0a24fbaa35fa33f8697d706ac8399a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Oct 2015 16:14:33 +0200 Subject: [PATCH] Use the new card banner for members --- htdocs/adherents/agenda.php | 24 +++--- htdocs/adherents/card.php | 99 ++++++++--------------- htdocs/adherents/card_subscriptions.php | 30 +++---- htdocs/core/class/commonobject.class.php | 32 ++++---- htdocs/core/lib/functions.lib.php | 27 ++++--- htdocs/societe/notify/card.php | 14 ++-- htdocs/theme/common/gmap.png | Bin 345 -> 675 bytes 7 files changed, 97 insertions(+), 129 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 71106dddee6..74036ec8e8d 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -84,16 +84,14 @@ if ($object->id > 0) dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Reference - print ''; - print ''; - print ''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + + print '
'; + print '
'.$langs->trans('Ref').''; - print $form->showrefnav($object, 'id', $linkback); - print '
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) @@ -101,6 +99,9 @@ if ($object->id > 0) print ''; } + // Type + print '\n"; + // Morphy print ''; /*print '';*/ print ''; - // Type - print '\n"; - // Company print ''; @@ -132,6 +130,8 @@ if ($object->id > 0) print ''; + dol_fiche_end(); + /* * Barre d'action diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index bc2dcec7f6a..2123b59ab8d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -802,13 +802,6 @@ else print ''; } - // Moral-Physique - $morphys["phy"] = $langs->trans("Physical"); - $morphys["mor"] = $langs->trans("Moral"); - print '\n"; - // Type print '\n"; + // Morphy + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Moral"); + print '\n"; + // Company print ''; @@ -1050,7 +1050,7 @@ else print ''; } - // Physique-Moral + // Morphy $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Morale"); print ''; print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().''; @@ -108,9 +109,6 @@ if ($object->id > 0) print '
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">
'.$langs->trans("Nature")."\n"; - print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1); - print "
'.$langs->trans("MemberType").''; $listetype=$adht->liste_array(); @@ -820,6 +813,13 @@ else } print "
'.$langs->trans("Nature")."\n"; + print $form->selectarray("morphy", $morphys, GETPOST('morphy','alpha')?GETPOST('morphy','alpha'):$object->morphy, 1); + print "
'.$langs->trans("Company").'
'.$langs->trans("Login").' / '.$langs->trans("Id").'login).'">
'.$langs->trans("Nature").''; @@ -1402,37 +1402,29 @@ else if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->skype->enabled)) $rowspan++; - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - $showphoto=''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'rowid', $linkback); - print '
'; - $showphoto.=$form->showphoto('memberphoto',$object); - $showphoto.='
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; - // Photo - print $showphoto; $showphoto=''; - print ''; + print ''; } - // Morphy - print ''; - print $showphoto; $showphoto=''; - print ''; - // Type print '\n"; + // Morphy + print ''; + print ''; + // Company print ''; @@ -1447,9 +1439,6 @@ else // Firstname print ''; - // EMail - print ''; - // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { @@ -1463,48 +1452,26 @@ else print ''; } - // Address - print ''; - - // Zip / Town - print ''; - - // Country - print ''; - - // State - print ''; - - // Tel pro. - print ''; - - // Tel perso - print ''; - - // Tel mobile - print ''; - // Skype if (! empty($conf->skype->enabled)) { print ''; } + print '
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Company").''.$object->societe.'
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).'
'.$langs->trans("Address").''; - dol_print_address($object->address,'gmap','member',$object->id); - print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$object->zip.(($object->zip && $object->town)?' / ':'').$object->town.'
'.$langs->trans("Country").''; - $img=picto_from_langcode($object->country_code); - if ($img) print $img.' '; - print getCountry($object->country_code); - print '
'.$langs->trans('State').''.$object->state.'
'.$langs->trans("PhonePro").''.dol_print_phone($object->phone,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("PhonePerso").''.dol_print_phone($object->phone_perso,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'; + + print ''; + print '
'; + + print '
'; + print ''; + // Birthday print ''; // Public print ''; - // Status - print ''; - // Categories if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { @@ -1594,12 +1561,16 @@ else print "
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans("Public").''.yn($object->public).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
\n"; - print "
\n"; - + print "
\n"; + print '
'; + dol_fiche_end(); + + /* * Hotbar */ + print '
'; $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 92af9c5981e..fb3807fcc5c 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -567,34 +567,31 @@ if ($rowid > 0) dol_fiche_head($head, 'subscription', $langs->trans("Member"), 0, 'user'); - print ''; - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - print ''; - - $showphoto=''; + + dol_banner_tab($object, 'rowid', $linkback); + + print '
'; + + print '
'; + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'rowid', $linkback); - print '
'.$form->showphoto('memberphoto',$object).'
'; // Login if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { - print ''; + print ''; print $showphoto; $showphoto=''; print ''; } + // Type + print '\n"; + // Morphy print ''; print $showphoto; $showphoto=''; print ''; - // Type - print '\n"; - // Company print ''; @@ -701,14 +698,13 @@ if ($rowid > 0) print "
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Login").' / '.$langs->trans("Id").''.$object->login.' 
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Nature").''.$object->getmorphylib().'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Company").''.$object->societe.'
\n"; + print '
'; + dol_fiche_end(); print ''; - dol_htmloutput_errors($errmsg,$errmsgs); - - /* * Hotbar */ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7cb29b66544..d20d5d82bde 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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?'
':''); - 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',' ','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?'
':''); + 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',' ','phone',$langs->trans("PhonePro")); $outdone++; } if (! empty($this->phone_pro)) { - $out.=dol_print_phone($this->phone_pro,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + $out.=dol_print_phone($this->phone_pro,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; } if (! empty($this->phone_mobile)) { - $out.=dol_print_phone($this->phone_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; + $out.=dol_print_phone($this->phone_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; } if (! empty($this->phone_perso)) { - $out.=dol_print_phone($this->phone_perso,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePerso")); $outdone++; + $out.=dol_print_phone($this->phone_perso,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePerso")); $outdone++; } if (! empty($this->fax)) { - $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; + $out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; } if (! empty($this->office_phone)) { - $out.=dol_print_phone($this->office_phone,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; + $out.=dol_print_phone($this->office_phone,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhonePro")); $outdone++; } if (! empty($this->user_mobile)) { - $out.=dol_print_phone($this->user_mobile,$country_code['code'],$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; + $out.=dol_print_phone($this->user_mobile,$this->country_code,$contactid,$thirdpartyid,'AC_TEL',' ','phone',$langs->trans("PhoneMobile")); $outdone++; } if (! empty($this->office_fax)) { - $out.=dol_print_phone($this->fax,$country_code['code'],$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; + $out.=dol_print_phone($this->fax,$this->country_code,$contactid,$thirdpartyid,'AC_FAX',' ','fax',$langs->trans("Fax")); $outdone++; } $out.='
'; $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++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9b8b6fcbcc3..ec3705c825c 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -732,7 +732,8 @@ 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++) { if ((is_numeric($active) && $i == $active) || (! empty($links[$i][2]) && ! is_numeric($active) && $active == $links[$i][2])) @@ -1496,30 +1497,30 @@ 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 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) - * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx - * @param string $withpicto Show picto - * @param string $titlealt Text to show on alt - * @return string Formated phone number + * @param string $phone Phone number to format + * @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) + * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx + * @param string $withpicto Show picto + * @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=" ",$withpicto='',$titlealt='') +function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$separ=" ",$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) { diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index 1b85cf36ab7..44bafd08406 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -186,13 +186,13 @@ if ($result > 0) print '
'; + // Help + print '
'.$langs->trans("NotificationsDesc"); + print ''; dol_fiche_end(); - // Help - print $langs->trans("NotificationsDesc").'

'; - 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 ''; print $form->selectarray("contactid",$listofemails); diff --git a/htdocs/theme/common/gmap.png b/htdocs/theme/common/gmap.png index 4636e2c848f003cd5bc4269f3359432b66791dcf..0423a91295654c414c56ff401e1b03257fb2c45e 100644 GIT binary patch literal 675 zcmV;U0$lxxP)eSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00H|+ zL_t(2&xOiQNEA^3fbs9mo7q;ql-5f_CHL1FZVvLGY88No`h5kww>tV=?);UPLC zwS*!>*rh|a=oTz==u)9kL6IV&lBqT6+MnIr)o9+#o7bs}Q2ve|p8)9Y?q+Cch_1_5 zcDF`IRYvUOs<9^C$;yZKuJz7lG8wYjETW^MgIq4h_4DWMo`^*+Y^jK1YzHYNu7;;8 zK~Hbr&B0VEg#fsiKG}1%F*e{!2jSS*PJ~d}2q}?La%Z7*;8y>@YYU*o@&`Omfv=b< zmKmJp^?K>g@<10$PJ^IGym@JmbPRv6PV6kw2 zm$mW~VZ_0a2BkbaOW;_7Fz^w8rvm0&H?%2zpLw?M)jQRk*kB8Iu&a@`s~!ip#=!S6 zz~kxp#hKyfWeecZ$HlISP-A?B2z>TcMG2Kp=qntp8Fd#91ISn`#^Z3qf0#W2kk99l{N<}+ zUK6GgwMVrv7y)Nryib2|-BH$x$KwFe{zENhBHeCowCz^_O-)Vw)1HQHnX%3`W7pJn z@;`}00-_u1a_xIHKr)$RUDZ{az5x`A#r5a<`ugMLa#^hHe*lG3+UN9y-);Z^002ov JPDHLkV1l%FFtz{y delta 336 zcmZ3?dXvesGr-TCmrII^fq{Y7)59eQNb`U&2Q!dNT)pNhkYX?K^mS#w&B`OBr}X`v zCrAxvfk$L90|U1Z2s2)~TlZ(8qHuj_fKQ0)|NsA!laswHEuU}QTWsm{|J=1>#o6!Y z%vrm%=Uz+k(&V5iJ=x#q^jyo1I#*qNEj#&tPxbTSsOK#$-&?AIMnA94{$5>uuekbu zPsX!FYru?5X=UjF1*6ieC)x|=$!rn2| zF)%Qe1o;IsI6S+N26SYUr;B4q#Vy}6;d~7SJj?-`4`rQR_J;Sny;8@thy5q~r!mDW zoXgk5b@ucw-Ka&c+Y5!bHm#byZ4y`JvCoUHbay;b>AT0@vw8VpWqS_!hCAg9I=6o^ fe7>G|=R3<%1?H=Jx~DY&ZDH_q^>bP0l+XkK=Dd(6