diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 399cc712297..0e04b77bb90 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -862,7 +862,7 @@ else print ''.$langs->trans("PhoneMobile").''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans("Skype").''; } @@ -1104,7 +1104,8 @@ else print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; // Skype - if (! empty($conf->skype->enabled)) { + if (! empty($conf->skype->enabled) && $user->rights->skype->view) + { print ''.$langs->trans("Skype").'skype).'">'; } @@ -1427,8 +1428,11 @@ else print ''.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).''; // Skype - print ''.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).''; - + if (! empty($conf->skype->enabled) && $user->rights->skype->view) + { + print ''.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).''; + } + // Birthday print ''.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 29ee792c738..5dfbdb9f254 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -268,7 +268,7 @@ if ($id > 0) print ''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').''; } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 3334a12b069..dfdcfc79949 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -526,7 +526,7 @@ else print ''.$langs->trans("IM").'jabberid).'">'; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans("Skype").'skype).'">'; } @@ -733,7 +733,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans("Skype").'skype).'">'; } @@ -952,7 +952,7 @@ else print ''; // Skype - if (!empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).''; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2b1c5e982df..6827e2c4f84 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -292,7 +292,7 @@ if ($result) print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); - if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder); @@ -328,7 +328,7 @@ if ($result) print ''; print ''; print ''; - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''; print ''; @@ -397,7 +397,7 @@ if ($result) // EMail print ''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''; // Skype - if (! empty($conf->skype->enabled)) { print ''.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).''; } + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).''; } // Date print ''.dol_print_date($db->jdate($obj->tms),"day").''; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index c08be97cac4..83da19cb5db 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1,12 +1,13 @@ - * Copyright (C) 2006 Rodolphe Quiedeville - * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2013 Florian Henry - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2006 Rodolphe Quiedeville + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2013 Christophe Battarel - * * + * Copyright (C) 2013 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 * the Free Software Foundation; either version 3 of the License, or @@ -576,7 +577,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email","",$param,'',$sortfield,$sortorder); - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { $colspan++; print ''.$langs->trans("Skype").''; @@ -608,8 +609,8 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ' '; - print ' '; - if (! empty($conf->skype->enabled)) + print ' '; + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { $colspan++; print ' '; @@ -681,7 +682,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); print ''; - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''; print dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8da52e301e6..b91a19a9820 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1190,11 +1190,11 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid= * Show Skype link * * @param string $skype Skype to show (only skype, without 'Name of recipient' before) - * @param int $cid Id of contact if known + * @param int $cid Id of contact if known * @param int $socid Id of third party if known * @param int $addlink 0=no link to create action - * @param int $max Max number of characters to show - * @return string HTML Link + * @param int $max Max number of characters to show + * @return string HTML Link */ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) { @@ -1208,9 +1208,12 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) { $newskype=''; - $newskype.=' '; + $newskype.='?call" alt="'.$langs->trans("Call").' '.$skype.'" title="'.$langs->trans("Call").' '.$skype.'">'; + $newskype.=' '; + $newskype.=' '; + $newskype.=' '; $newskype.=''; if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) diff --git a/htdocs/install/mysql/migration/2.1.0-2.2.0.sql b/htdocs/install/mysql/migration/2.1.0-2.2.0.sql index 070682d3c50..cc3988f8a42 100644 --- a/htdocs/install/mysql/migration/2.1.0-2.2.0.sql +++ b/htdocs/install/mysql/migration/2.1.0-2.2.0.sql @@ -71,12 +71,13 @@ update llx_bank set dateo = datec where datev = '1970-01-01 00:00:00' and rappro alter table llx_c_chargesociales add column actioncompta varchar(12) NOT NULL; insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 1, 'Allocations familiales', 1,1,'TAXFAM'); -insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 2, 'GSG Deductible', 1,1,'TAXCSGD'); -insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 3, 'GSG/CRDS NON Deductible',0,1,'TAXCSGND'); -insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (10, 'Taxe apprenttissage', 0,1,'TAXAPP'); +insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 2, 'GSG Déductible', 1,1,'TAXCSGD'); +insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values ( 3, 'GSG/CRDS NON Déductible',0,1,'TAXCSGND'); +insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (10, 'Taxe apprentissage', 0,1,'TAXAPP'); insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (11, 'Taxe professionnelle', 0,1,'TAXPRO'); +insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (12, 'Contribution à la formation professionnelle', 1,1,'TAXOPCA'); insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (20, 'Impots locaux/fonciers', 0,1,'TAXFON'); -insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (30, 'Assurance Sante (SECU-URSSAF)', 0,1,'TAXSECU'); +insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (30, 'Assurance Santé (SECU-URSSAF)', 0,1,'TAXSECU'); insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (40, 'Mutuelle', 0,1,'TAXMUT'); insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (50, 'Assurance vieillesse (CNAV)', 0,1,'TAXRET'); insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (60, 'Assurance Chomage (ASSEDIC)', 0,1,'TAXCHOM'); diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index cdf9c3e5770..227ce4442fb 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -68,6 +68,7 @@ CountryId=Country id Phone=Phone Skype=Skype Call=Call +Chat=Chat PhonePro=Prof. phone PhonePerso=Pers. phone PhoneMobile=Mobile diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 9d5a707aac1..cc4d2c6754f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -876,7 +876,7 @@ else print ''.$langs->trans('Web').''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans('Skype').''; } @@ -1300,7 +1300,7 @@ else print ''.$langs->trans('Web').''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans('Skype').''; } @@ -1592,12 +1592,12 @@ else // Country print ''.$langs->trans("Country").''; - if ($object->country_code) - { - $img=picto_from_langcode($object->country_code); - if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); - else print ($img?$img.' ':'').$object->country; - } + if ($object->country_code) + { + $img=picto_from_langcode($object->country_code); + if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0); + else print ($img?$img.' ':'').$object->country; + } print ''; // State @@ -1614,7 +1614,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled)) + if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''.$langs->trans('Skype').''; print dol_print_skype($object->skype,0,$object->id,'AC_SKYPE'); diff --git a/htdocs/theme/common/skype_callbutton.png b/htdocs/theme/common/skype_callbutton.png new file mode 100644 index 00000000000..79ee7963fc4 Binary files /dev/null and b/htdocs/theme/common/skype_callbutton.png differ diff --git a/htdocs/theme/common/skype_chatbutton.png b/htdocs/theme/common/skype_chatbutton.png new file mode 100644 index 00000000000..788c31fec21 Binary files /dev/null and b/htdocs/theme/common/skype_chatbutton.png differ diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 54a9093bd34..44686e9277e 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013 Florian Henry * @@ -78,7 +78,7 @@ $formadmin=new FormAdmin($db); /* * Actions */ -if ($action == 'update' && ($caneditfield || $user->admin)) +if ($action == 'update' && ($caneditfield || ! empty($user->admin))) { if (! $_POST["cancel"]) { @@ -258,7 +258,7 @@ else } else { - if ($user->id == $fuser->id || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin + if ($caneditfield || ! empty($user->admin)) // Si utilisateur edite = utilisateur courant (pas besoin de droits particulier car il s'agit d'une page de modif d'output et non de données) ou si admin { print 'id.'">'.$langs->trans("Modify").''; }