2
0
forked from Wavyzz/dolibarr

Finish work on better integration of skype

This commit is contained in:
aspangaro
2015-11-28 14:43:16 +01:00
parent 9817ce8b20
commit d12e3ca91f
9 changed files with 16 additions and 191 deletions

View File

@@ -1,162 +0,0 @@
<?php
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/skype.php
* \ingroup Skype
* \brief Skype module setup page
*/
require('../main.inc.php');
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("admin");
if (! $user->admin) accessforbidden();
/*
* Actions
*/
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
else if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/*
* View
*/
$help_url='';
llxHeader('', $langs->trans('Parameters'));
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("SkypeSetup"), $linkback);
$var=true;
$form = new Form($db);
// Configuration header
$h = 0;
$head = array ();
$head[$h][0] = dol_buildpath('/admin/skype.php', 1);
$head[$h][1] = $langs->trans("Configuration");
$head[$h][2] = 'parameters';
$h ++;
dol_fiche_head($head, 'parameters', $langs->trans("Skype"), 0, "skype");
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans('Parameters') . '</td>';
print "</tr>\n";
$var = ! $var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("SkypeDeactivateInUser") . '</td>';
print '<td align="left">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('SKYPE_DEACTIVATE_IN_USER');
}
else
{
if (empty($conf->global->SKYPE_DEACTIVATE_IN_USER))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_SKYPE_DEACTIVATE_IN_USER">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_SKYPE_DEACTIVATE_IN_USER">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td>';
print '</tr>';
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("SkypeDeactivateInContact") . '</td>';
print '<td align="left">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('SKYPE_DEACTIVATE_IN_CONTACT');
}
else
{
if (empty($conf->global->SKYPE_DEACTIVATE_IN_CONTACT))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_SKYPE_DEACTIVATE_IN_CONTACT">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_SKYPE_DEACTIVATE_IN_CONTACT">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td>';
print '</tr>';
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("SkypeDeactivateInMember") . '</td>';
print '<td align="left">';
if ($conf->use_javascript_ajax)
{
print ajax_constantonoff('SKYPE_DEACTIVATE_IN_MEMBER');
}
else
{
if (empty($conf->global->SKYPE_DEACTIVATE_IN_MEMBER))
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_SKYPE_DEACTIVATE_IN_MEMBER">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
}
else
{
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_SKYPE_DEACTIVATE_IN_MEMBER">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
}
}
print '</td>';
print '</tr>';
print "</table>\n";
dol_fiche_end();
print '</form>';
llxFooter();
$db->close();

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr> * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* *
@@ -1156,12 +1156,6 @@ else
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>';
} }
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td><td>'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
}
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>'; print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>';
print $object->LibPubPriv($object->priv); print $object->LibPubPriv($object->priv);
print '</td></tr>'; print '</td></tr>';

View File

@@ -530,7 +530,9 @@ abstract class CommonObject
} }
if (! empty($conf->skype->enabled)) if (! empty($conf->skype->enabled))
{ {
if ($this->skype) $out.=($outdone?'<br>':'').dol_print_skype($this->skype,$this->id,$object->id,'AC_SKYPE'); $out.='<div style="clear: both;"></div>';
if ($this->skype) $out.=dol_print_skype($this->skype,$this->id,$object->id,'AC_SKYPE');
$outdone++;
} }
$out.='<!-- END Part to show address block -->'; $out.='<!-- END Part to show address block -->';

View File

@@ -1520,14 +1520,18 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
if (! empty($addlink)) if (! empty($addlink))
{ {
$newskype='<a href="skype:'; $newskype =img_picto($langs->trans("Skype"), 'object_skype.png');
$newskype.= '&nbsp;';
$newskype.=dol_trunc($skype,$max);
$newskype.= '&nbsp;';
$newskype.='<a href="skype:';
$newskype.=dol_trunc($skype,$max); $newskype.=dol_trunc($skype,$max);
$newskype.='?call" alt="'.$langs->trans("Call").'&nbsp;'.$skype.'" title="'.$langs->trans("Call").'&nbsp;'.$skype.'">'; $newskype.='?call" alt="'.$langs->trans("Call").'&nbsp;'.$skype.'" title="'.$langs->trans("Call").'&nbsp;'.$skype.'">';
$newskype.='<img src="../theme/common/skype_callbutton.png" border="0">'; $newskype.='<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
$newskype.='</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="skype:'; $newskype.='</a>&nbsp;&nbsp;&nbsp;<a href="skype:';
$newskype.=dol_trunc($skype,$max); $newskype.=dol_trunc($skype,$max);
$newskype.='?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$skype.'" title="'.$langs->trans("Chat").'&nbsp;'.$skype.'">'; $newskype.='?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$skype.'" title="'.$langs->trans("Chat").'&nbsp;'.$skype.'">';
$newskype.='<img src="../theme/common/skype_chatbutton.png" border="0">'; $newskype.='<img src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
$newskype.='</a>'; $newskype.='</a>';
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)

View File

@@ -61,7 +61,7 @@ class modSkype extends DolibarrModules
// Config pages // Config pages
//------------- //-------------
$this->config_page_url = array("skype.php"); $this->config_page_url = array();
// Dependancies // Dependancies
//------------- //-------------

View File

@@ -540,7 +540,7 @@ Module2800Desc=FTP Client
Module2900Name=GeoIPMaxmind Module2900Name=GeoIPMaxmind
Module2900Desc=GeoIP Maxmind conversions capabilities Module2900Desc=GeoIP Maxmind conversions capabilities
Module3100Name=Skype Module3100Name=Skype
Module3100Desc=Add a Skype button into card of adherents / third parties / contacts Module3100Desc=Add a Skype button into card of users / third parties / contacts / members
Module4000Name=HRM Module4000Name=HRM
Module4000Desc=Human resources management Module4000Desc=Human resources management
Module5000Name=Multi-company Module5000Name=Multi-company
@@ -1249,11 +1249,6 @@ AddSubscriptionIntoAccount=Suggest by default to create a bank transaction, in b
AdherentLoginRequired= Manage a Login for each member AdherentLoginRequired= Manage a Login for each member
AdherentMailRequired=EMail required to create a new member AdherentMailRequired=EMail required to create a new member
MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default
##### Skype setup #####
SkypeSetup=Skype module setup
SkypeDeactivateInUser=Deactivate Skype in user card
SkypeDeactivateInContact=Deactivate Skype in contact card
SkypeDeactivateInMember=Deactivate Skype in member card
##### LDAP setup ##### ##### LDAP setup #####
LDAPSetup=LDAP Setup LDAPSetup=LDAP Setup
LDAPGlobalParameters=Global parameters LDAPGlobalParameters=Global parameters

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 916 B

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -193,7 +193,7 @@ if (empty($reshook)) {
$object->office_phone = GETPOST("office_phone", 'alpha'); $object->office_phone = GETPOST("office_phone", 'alpha');
$object->office_fax = GETPOST("office_fax", 'alpha'); $object->office_fax = GETPOST("office_fax", 'alpha');
$object->user_mobile = GETPOST("user_mobile"); $object->user_mobile = GETPOST("user_mobile");
$object->skype = GETPOST("skype"); $object->skype = GETPOST("skype", 'alpha');
$object->email = GETPOST("email", 'alpha'); $object->email = GETPOST("email", 'alpha');
$object->job = GETPOST("job", 'alpha'); $object->job = GETPOST("job", 'alpha');
$object->signature = GETPOST("signature"); $object->signature = GETPOST("signature");
@@ -330,7 +330,7 @@ if (empty($reshook)) {
$object->office_phone = GETPOST("office_phone", 'alpha'); $object->office_phone = GETPOST("office_phone", 'alpha');
$object->office_fax = GETPOST("office_fax", 'alpha'); $object->office_fax = GETPOST("office_fax", 'alpha');
$object->user_mobile = GETPOST("user_mobile"); $object->user_mobile = GETPOST("user_mobile");
$object->skype = GETPOST("skype"); $object->skype = GETPOST("skype", 'alpha');
$object->email = GETPOST("email", 'alpha'); $object->email = GETPOST("email", 'alpha');
$object->job = GETPOST("job", 'alpha'); $object->job = GETPOST("job", 'alpha');
$object->signature = GETPOST("signature"); $object->signature = GETPOST("signature");
@@ -1325,14 +1325,6 @@ else
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
// Skype
if (! empty($conf->skype->enabled))
{
print '<tr><td>'.$langs->trans("Skype").'</td>';
print '<td>'.dol_print_skype($object->skype,0,0,1).'</td>';
print "</tr>\n";
}
// Signature // Signature
print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td>'; print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td>';
print dol_htmlentitiesbr($object->signature); print dol_htmlentitiesbr($object->signature);