forked from Wavyzz/dolibarr
Finish work on better integration of skype
This commit is contained in:
@@ -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();
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* 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) 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>';
|
||||
}
|
||||
|
||||
// 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 $object->LibPubPriv($object->priv);
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -530,7 +530,9 @@ abstract class CommonObject
|
||||
}
|
||||
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 -->';
|
||||
|
||||
@@ -1520,14 +1520,18 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64)
|
||||
|
||||
if (! empty($addlink))
|
||||
{
|
||||
$newskype='<a href="skype:';
|
||||
$newskype =img_picto($langs->trans("Skype"), 'object_skype.png');
|
||||
$newskype.= ' ';
|
||||
$newskype.=dol_trunc($skype,$max);
|
||||
$newskype.= ' ';
|
||||
$newskype.='<a href="skype:';
|
||||
$newskype.=dol_trunc($skype,$max);
|
||||
$newskype.='?call" alt="'.$langs->trans("Call").' '.$skype.'" title="'.$langs->trans("Call").' '.$skype.'">';
|
||||
$newskype.='<img src="../theme/common/skype_callbutton.png" border="0">';
|
||||
$newskype.='</a> <a href="skype:';
|
||||
$newskype.='<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
|
||||
$newskype.='</a> <a href="skype:';
|
||||
$newskype.=dol_trunc($skype,$max);
|
||||
$newskype.='?chat" alt="'.$langs->trans("Chat").' '.$skype.'" title="'.$langs->trans("Chat").' '.$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>';
|
||||
|
||||
if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
|
||||
@@ -61,7 +61,7 @@ class modSkype extends DolibarrModules
|
||||
|
||||
// Config pages
|
||||
//-------------
|
||||
$this->config_page_url = array("skype.php");
|
||||
$this->config_page_url = array();
|
||||
|
||||
// Dependancies
|
||||
//-------------
|
||||
|
||||
@@ -540,7 +540,7 @@ Module2800Desc=FTP Client
|
||||
Module2900Name=GeoIPMaxmind
|
||||
Module2900Desc=GeoIP Maxmind conversions capabilities
|
||||
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
|
||||
Module4000Desc=Human resources management
|
||||
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
|
||||
AdherentMailRequired=EMail required to create a new member
|
||||
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 #####
|
||||
LDAPSetup=LDAP Setup
|
||||
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 |
@@ -193,7 +193,7 @@ if (empty($reshook)) {
|
||||
$object->office_phone = GETPOST("office_phone", 'alpha');
|
||||
$object->office_fax = GETPOST("office_fax", 'alpha');
|
||||
$object->user_mobile = GETPOST("user_mobile");
|
||||
$object->skype = GETPOST("skype");
|
||||
$object->skype = GETPOST("skype", 'alpha');
|
||||
$object->email = GETPOST("email", 'alpha');
|
||||
$object->job = GETPOST("job", 'alpha');
|
||||
$object->signature = GETPOST("signature");
|
||||
@@ -330,7 +330,7 @@ if (empty($reshook)) {
|
||||
$object->office_phone = GETPOST("office_phone", 'alpha');
|
||||
$object->office_fax = GETPOST("office_fax", 'alpha');
|
||||
$object->user_mobile = GETPOST("user_mobile");
|
||||
$object->skype = GETPOST("skype");
|
||||
$object->skype = GETPOST("skype", 'alpha');
|
||||
$object->email = GETPOST("email", 'alpha');
|
||||
$object->job = GETPOST("job", 'alpha');
|
||||
$object->signature = GETPOST("signature");
|
||||
@@ -1325,14 +1325,6 @@ else
|
||||
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
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Signature').'</td><td>';
|
||||
print dol_htmlentitiesbr($object->signature);
|
||||
|
||||
Reference in New Issue
Block a user