Standardize code: Move jabberid into social network module
This commit is contained in:
parent
b27ec54379
commit
3213b3be07
@ -89,7 +89,7 @@ dol_fiche_head($head, 'setup', '', 0, 'user');
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$arrayofsocialnetworks=array('skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
|
$arrayofsocialnetworks=array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook');
|
||||||
|
|
||||||
foreach($arrayofsocialnetworks as $snkey => $snlabel)
|
foreach($arrayofsocialnetworks as $snkey => $snlabel)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -125,11 +125,6 @@ echo $this->control->tpl['ajax_selectcountry'];
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><?php echo $langs->trans("IM"); ?></td>
|
|
||||||
<td colspan="3"><input name="jabberid" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['jabberid']; ?>"></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
||||||
<td colspan="3"><?php echo $this->control->tpl['select_visibility']; ?></td>
|
<td colspan="3"><?php echo $this->control->tpl['select_visibility']; ?></td>
|
||||||
|
|||||||
@ -110,11 +110,6 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><?php echo $langs->trans("IM"); ?></td>
|
|
||||||
<td colspan="3"><?php echo $this->control->tpl['jabberid']; ?></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
<td><?php echo $langs->trans("ContactVisibility"); ?></td>
|
||||||
<td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
|
<td colspan="3"><?php echo $this->control->tpl['visibility']; ?></td>
|
||||||
|
|||||||
@ -660,12 +660,14 @@ else
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Instant message and no email
|
|
||||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
|
||||||
print '<td colspan="3"><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
|
||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
{
|
||||||
|
// Jabber
|
||||||
|
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="skype">'.fieldLabel('Jabber','jabberid').'</label></td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||||
|
}
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
{
|
{
|
||||||
@ -919,9 +921,8 @@ else
|
|||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Jabberid
|
// Unsubscribe
|
||||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
print '<tr>';
|
||||||
print '<td><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
|
||||||
if (! empty($conf->mailing->enabled))
|
if (! empty($conf->mailing->enabled))
|
||||||
{
|
{
|
||||||
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||||
@ -935,6 +936,12 @@ else
|
|||||||
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
if (! empty($conf->socialnetworks->enabled))
|
||||||
{
|
{
|
||||||
|
// Jabber ID
|
||||||
|
if (! empty($conf->global->SOCIALNETWORKS_JABBER))
|
||||||
|
{
|
||||||
|
print '<tr><td><label for="jabberid">'.fieldLabel('Jabber','jabberid').'</label></td>';
|
||||||
|
print '<td><input type="text" name="jabberid" id="jabberid" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOSTISSET("jabberid")?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||||
|
}
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
if (! empty($conf->global->SOCIALNETWORKS_SKYPE))
|
||||||
{
|
{
|
||||||
@ -1153,8 +1160,7 @@ else
|
|||||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td></tr>';
|
print '<td><a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?filteremail='.urlencode($object->email).'">'.$object->getNbOfEMailings().'</a></td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instant message and no email
|
// Unsubscribe
|
||||||
print '<tr><td>'.$langs->trans("IM").'</td><td>'.$object->jabberid.'</td></tr>';
|
|
||||||
if (!empty($conf->mailing->enabled))
|
if (!empty($conf->mailing->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>';
|
print '<tr><td>'.$langs->trans("No_Email").'</td><td>'.yn($object->no_email).'</td></tr>';
|
||||||
|
|||||||
@ -158,6 +158,7 @@ $arrayfields=array(
|
|||||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
||||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||||
|
'p.jabberid'=>array('label'=>"Jabber", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||||
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||||
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
'p.twitter'=>array('label'=>"Twitter", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||||
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
'p.facebook'=>array('label'=>"Facebook", 'checked'=>1, 'enabled'=>(! empty($conf->socialnetworks->enabled))),
|
||||||
@ -822,12 +823,19 @@ while ($i < min($num,$limit))
|
|||||||
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($arrayfields['p.skype']['checked']))
|
if (! empty($arrayfields['p.skype']['checked']))
|
||||||
{
|
{
|
||||||
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->skype,$obj->rowid,$obj->socid,'skype').'</td>'; }
|
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->skype,$obj->rowid,$obj->socid,'skype').'</td>'; }
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Jabber
|
||||||
|
if (! empty($arrayfields['p.jabberid']['checked']))
|
||||||
|
{
|
||||||
|
if (! empty($conf->socialnetworks->enabled)) { print '<td>'.dol_print_socialnetworks($obj->jabberid,$obj->rowid,$obj->socid,'jabberid').'</td>'; }
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Twitter
|
// Twitter
|
||||||
if (! empty($arrayfields['p.twitter']['checked']))
|
if (! empty($arrayfields['p.twitter']['checked']))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -620,14 +620,10 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
if ($this->skype) $out.=dol_print_socialnetworks($this->skype,$this->id,$object->id,'skype');
|
if ($this->skype) $out.=dol_print_socialnetworks($this->skype,$this->id,$object->id,'skype');
|
||||||
$outdone++;
|
$outdone++;
|
||||||
}
|
if ($this->jabberid) $out.=dol_print_socialnetworks($this->jabberid,$this->id,$object->id,'jabber');
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
$outdone++;
|
||||||
{
|
|
||||||
if ($this->twitter) $out.=dol_print_socialnetworks($this->twitter,$this->id,$object->id,'twitter');
|
if ($this->twitter) $out.=dol_print_socialnetworks($this->twitter,$this->id,$object->id,'twitter');
|
||||||
$outdone++;
|
$outdone++;
|
||||||
}
|
|
||||||
if (! empty($conf->socialnetworks->enabled))
|
|
||||||
{
|
|
||||||
if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook,$this->id,$object->id,'facebook');
|
if ($this->facebook) $out.=dol_print_socialnetworks($this->facebook,$this->id,$object->id,'facebook');
|
||||||
$outdone++;
|
$outdone++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3010,7 +3010,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
if (empty($srconly) && in_array($pictowithoutext, array(
|
if (empty($srconly) && in_array($pictowithoutext, array(
|
||||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'list', 'listlight', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||||
'note','switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
|
'note','switch_off', 'switch_on', 'unlink', 'uparrow', '1downarrow', '1uparrow',
|
||||||
'skype','twitter','facebook'
|
'jabber','skype','twitter','facebook'
|
||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
$fakey = $pictowithoutext;
|
$fakey = $pictowithoutext;
|
||||||
@ -3093,10 +3093,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
elseif ($pictowithoutext == 'playdisabled') {
|
elseif ($pictowithoutext == 'playdisabled') {
|
||||||
$fakey = 'fa-play';
|
$fakey = 'fa-play';
|
||||||
$facolor = '#ccc';
|
$facolor = '#ccc';
|
||||||
} elseif ($pictowithoutext == 'play') {
|
}
|
||||||
|
elseif ($pictowithoutext == 'play') {
|
||||||
$fakey = 'fa-play';
|
$fakey = 'fa-play';
|
||||||
$facolor = '#444';
|
$facolor = '#444';
|
||||||
}
|
}
|
||||||
|
elseif ($pictowithoutext == 'jabber') {
|
||||||
|
$fakey = 'fa-comment-o';
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$fakey = 'fa-'.$pictowithoutext;
|
$fakey = 'fa-'.$pictowithoutext;
|
||||||
$facolor = '#444';
|
$facolor = '#444';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user