diff --git a/htdocs/admin/skype.php b/htdocs/admin/skype.php new file mode 100644 index 00000000000..a1778afd101 --- /dev/null +++ b/htdocs/admin/skype.php @@ -0,0 +1,166 @@ + + * + * 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 . + */ + +/** + * \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(); + +$action = GETPOST('action', 'alpha'); + +/* + * 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 + */ +llxHeader('', $langs->trans('Parameters')); + +$form = new Form($db); + +dol_htmloutput_mesg($mesg); + +// Subheader +$linkback = '' . $langs->trans("BackToModuleList") . ''; +print load_fiche_titre($langs->trans("SkypeSetup"), $linkback); + +// 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"); + +if (! $conf->use_javascript_ajax) { + print '
'; + print ''; + print ''; +} + +print ''; +print ''; +print ''; +print "\n"; + +$var = ! $var; + +print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; + +print ''; +print ''; +print ''; + +print "
' . $langs->trans('Parameters') . '
' . $langs->trans("SkypeDeactivateInUser") . ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SKYPE_DEACTIVATE_IN_USER'); +} +else +{ + if (empty($conf->global->SKYPE_DEACTIVATE_IN_USER)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } +} +print '
' . $langs->trans("SkypeDeactivateInContact") . ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SKYPE_DEACTIVATE_IN_CONTACT'); +} +else +{ + if (empty($conf->global->SKYPE_DEACTIVATE_IN_CONTACT)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } +} +print '
' . $langs->trans("SkypeDeactivateInMember") . ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SKYPE_DEACTIVATE_IN_MEMBER'); +} +else +{ + if (empty($conf->global->SKYPE_DEACTIVATE_IN_MEMBER)) + { + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + } + else + { + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + } +} +print '
\n"; + +dol_fiche_end(); + +print '
'; + +llxFooter(); +$db->close(); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 388f51e7dc5..9cb9a3d45ab 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9,6 +9,7 @@ * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2015 Alexandre Spangaro * * 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 diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php index 280b871e475..2c7686d9349 100644 --- a/htdocs/core/modules/modSkype.class.php +++ b/htdocs/core/modules/modSkype.class.php @@ -42,8 +42,8 @@ class modSkype extends DolibarrModules $this->db = $db; $this->numero = 3100; - // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' - // It is used to group modules in module setup page + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page $this->family = "crm"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i','',get_class($this)); @@ -61,7 +61,7 @@ class modSkype extends DolibarrModules // Config pages //------------- - $this->config_page_url = array(); + $this->config_page_url = array("skype.php"); // Dependancies //------------- diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b497bb45fc7..fff2ea5c32f 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1249,6 +1249,11 @@ 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