diff --git a/README-FR b/README-FR index 8b3900ff78c..c89314be22a 100644 --- a/README-FR +++ b/README-FR @@ -123,6 +123,6 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr: - Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise). - Dolibarr ne gère en standard qu'une société/institution/association mère (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. - Dolibarr ne contient pas de module de Gestion de la paie. -- Les taches du module de gestion de projets n'ont pas de dépendance entre elle. +- Les tâches du module de gestion de projets n'ont pas de dépendance entre elle. - Dolibarr ne contient pas de Webmail. - Dolibarr ne fait pas le café (pas encore). diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 275e9323223..d6e97de921e 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -263,7 +263,7 @@ print '
'; /* - * Edition des variables globales non rattache a un theme specifique + * Edition des variables globales non rattachées à un theme specifique */ $constantes=array( 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT', diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 255eb1533d9..f12a1b47fee 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -65,6 +65,7 @@ class Adherent extends CommonObject var $country; var $email; + var $skype; var $phone; var $phone_perso; var $phone_mobile; @@ -430,6 +431,7 @@ class Adherent extends CommonObject $sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null"); $sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null"); $sql.= ", email='".$this->email."'"; + $sql.= ", skype='".$this->skype."'"; $sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null"); $sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null"); $sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null"); @@ -526,6 +528,7 @@ class Adherent extends CommonObject $luser->societe_id=$this->societe; $luser->email=$this->email; + $luser->skype=$this->skype; $luser->office_phone=$this->phone; $luser->user_mobile=$this->phone_mobile; @@ -564,6 +567,7 @@ class Adherent extends CommonObject $lthirdparty->zip=$this->zip; $lthirdparty->town=$this->town; $lthirdparty->email=$this->email; + $lthirdparty->skype=$this->skype; $lthirdparty->phone=$this->phone; $lthirdparty->state_id=$this->state_id; $lthirdparty->country_id=$this->country_id; @@ -1047,7 +1051,7 @@ class Adherent extends CommonObject global $langs; $sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; - $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; + $sql.= " d.email, d.skype, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; $sql.= " d.tms as datem,"; @@ -1115,6 +1119,7 @@ class Adherent extends CommonObject $this->phone_perso = $obj->phone_perso; $this->phone_mobile = $obj->phone_mobile; $this->email = $obj->email; + $this->skype = $obj->skype; $this->photo = $obj->photo; $this->statut = $obj->statut; @@ -1782,6 +1787,7 @@ class Adherent extends CommonObject $this->country = 'France'; $this->morphy = 1; $this->email = 'specimen@specimen.com'; + $this->skype = 'tom.hanson'; $this->phone = '0999999999'; $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; @@ -1853,6 +1859,7 @@ class Adherent extends CommonObject if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town; if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; + if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype; if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 251eb062b15..d019e4004d8 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -285,6 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->phone_perso = trim($_POST["phone_perso"]); $object->phone_mobile= trim($_POST["phone_mobile"]); $object->email = trim($_POST["email"]); + $object->skype = trim($_POST["skype"]); $object->birth = $birthdate; $object->typeid = $_POST["typeid"]; @@ -413,6 +414,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $phone=$_POST["phone"]; $phone_perso=$_POST["phone_perso"]; $phone_mobile=$_POST["phone_mobile"]; + $skype=$_POST["member_skype"]; $email=$_POST["member_email"]; $login=$_POST["member_login"]; $pass=$_POST["password"]; @@ -437,6 +439,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->phone = $phone; $object->phone_perso = $phone_perso; $object->phone_mobile= $phone_mobile; + $object->skype = $skype; $object->email = $email; $object->login = $login; $object->pass = $pass; @@ -844,6 +847,12 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + } + // Birthday print "".$langs->trans("Birthday")."\n"; $form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc'); @@ -1080,6 +1089,11 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; + // Skype + if (! empty($conf->skype->enabled)) { + print ''.$langs->trans("Skype").'skype).'">'; + } + // Birthday print "".$langs->trans("Birthday")."\n"; $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); @@ -1398,6 +1412,9 @@ else // Tel mobile 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).''; + // Birthday print ''.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').''; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index a80c41cd60b..fd2ea1dc966 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -220,11 +220,10 @@ $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'setup'); -print "
"; $head=fichinter_admin_prepare_head(); -dol_fiche_head($head, 'ficheinter', $langs->trans("ModuleSetup")); +dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), 0, 'intervention'); // Interventions numbering model diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 8406bef31a9..a25fe2c13c7 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -61,6 +61,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',GETPOST("fieldhomephone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; @@ -214,6 +215,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print 'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_MOBILE?' checked="checked"':'').">"; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print 'global->LDAP_KEY_CONTACTS && $conf->global->LDAP_KEY_CONTACTS==$conf->global->LDAP_CONTACT_FIELD_SKYPE?' checked="checked"':'').">"; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 39847fc3025..f437163b22f 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -65,6 +65,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',GETPOST("fieldphoneperso"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; @@ -255,6 +256,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print ' '; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print ' '; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index a9d530cd8d9..647cccf7ab8 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -63,6 +63,7 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++; @@ -240,6 +241,14 @@ print ''.$langs->trans("LDAPFieldMobileExample").''; print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_MOBILE)?' checked="checked"':'').">"; print ''; +// Skype +$var=!$var; +print ''.$langs->trans("LDAPFieldSkype").''; +print ''; +print ''.$langs->trans("LDAPFieldSkypeExample").''; +print 'global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_SKYPE)?' checked="checked"':'').">"; +print ''; + // Fax $var=!$var; print ''.$langs->trans("LDAPFieldFax").''; @@ -383,6 +392,7 @@ if (function_exists("ldap_connect")) $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, $conf->global->LDAP_FIELD_PHONE, $conf->global->LDAP_FIELD_FAX, + $conf->global->LDAP_FIELD_SKYPE, $conf->global->LDAP_FIELD_MOBILE, $conf->global->LDAP_FIELD_MAIL, $conf->global->LDAP_FIELD_TITLE, diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 8574e6eb5ad..c648a7d312b 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2010-2012 Juanjo Menent + * 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 @@ -196,9 +197,8 @@ if ($id > 0) print '
'; - //print ''; - //print ''; } print ''; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index c56688b3e44..8c2871426a4 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -100,7 +100,7 @@ $hookmanager->initHooks(array('propalcard')); /* * Actions -*/ + */ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -131,7 +131,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') } } -// Suppression de la propale +// Delete proposal else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->propal->supprimer) { $result=$object->delete($user); @@ -436,9 +436,7 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST( } } -/* - * Add file in email form -*/ +// Add file in email form if (GETPOST('addfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -451,9 +449,7 @@ if (GETPOST('addfile')) $action='presend'; } -/* - * Remove file in email form -*/ +// Remove file in email form if (GETPOST('removedfile')) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -469,7 +465,7 @@ if (GETPOST('removedfile')) /* * Send mail -*/ + */ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { $langs->load('mails'); @@ -637,7 +633,7 @@ else if ($action == "setabsolutediscount" && $user->rights->propal->creer) } } -//Ajout d'une ligne produit dans la propale +// Add line else if ($action == "addline" && $user->rights->propal->creer) { $idprod=GETPOST('idprod', 'int'); @@ -1163,14 +1159,11 @@ else if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if($ret < 0) $error++; - if($ret < 0) { - $error++; - $action = 'edit_extras'; - } - - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('propaldao')); @@ -1178,17 +1171,16 @@ else if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } + + if ($error) $action = 'edit_extras'; } if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer) @@ -1254,7 +1246,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> /* * View -*/ + */ llxHeader('',$langs->trans('Proposal'),'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); @@ -1422,7 +1414,7 @@ if ($action == 'create') /* * Combobox pour la fonction de copie - */ + */ if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE)) { @@ -1521,7 +1513,7 @@ else { /* * Show object in view mode - */ + */ $soc = new Societe($db); $soc->fetch($object->socid); @@ -1615,13 +1607,12 @@ else print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print ''; - // Ref client + // Ref customer print ''; print ''; + // Company print ''; print ''; @@ -1897,20 +1889,12 @@ else print ''; } - // Other attributes + // Other attributes (TODO Move this into an include) $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { @@ -1933,35 +1917,28 @@ else $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->propal->creer) + if ($action == 'edit_extras' && $user->rights->propal->creer && GETPOST('attribute') == $key) { + print ''; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + + print ''; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->propal->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->propal->creer) - { - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->propal->creer) - { - print ''; - } - } - } } // Amount HT @@ -2024,7 +2001,7 @@ else /* * Lines - */ + */ if (! empty($conf->use_javascript_ajax) && $object->statut == 0) { @@ -2077,7 +2054,7 @@ else { /* * Formulaire cloture (signe ou non) - */ + */ $form_close = ''; $form_close.= ''; $form_close.= '
'; + print ''; print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Assujeti a TVA ou pas print ''; print ''; print "\n"; @@ -462,8 +468,6 @@ if ($id > 0) print '
'; - //print "\n"; - //print '
"; - //print "
'.$langs->trans("ThirdPartyName").''; @@ -267,6 +267,12 @@ if ($id > 0) // Fax print ''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
'.$langs->trans('VATIsUsed').''; @@ -452,7 +458,7 @@ if ($id > 0) } else { - print $langs->trans("UserNotLinkedToMember"); + print $langs->trans("ThirdpartyNotLinkedToMember"); } print '
'; // Nbre max d'elements des petites listes @@ -800,8 +804,6 @@ if ($id > 0) print ''; print '
'; - //print "
"; dol_fiche_end(); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 538d4c04fc4..5b3ec5bfc1d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -507,7 +507,7 @@ if ($object->fetch($id) >= 0) if ($obj->statut==-1) print $langs->trans("MailingStatusError").' '.img_error(); if ($obj->statut==1) print $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut4'); if ($obj->statut==2) print $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut6'); - if ($obj->statut==3) print $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut8'); + if ($obj->statut==3) print $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut5'); print '
'; print ''; - print ''; - print ''; if ($action != 'refclient' && ! empty($object->brouillon)) print ''; + print ''; print '
'; print $langs->trans('RefCustomer').''.img_edit($langs->transnoentitiesnoconv('RefCustomer')).''.img_edit($langs->trans('Modify')).'
'; print '
'; if ($user->rights->propal->creer && $action == 'refclient') @@ -1639,6 +1630,7 @@ else } print '
'.$langs->trans('Company').''.$soc->getNomUrl(1).'
'; - print ''; - print ''; - print '
'.img_picto('','edit').' '.$langs->trans('Modify').'
'; @@ -2105,7 +2082,7 @@ else /* * Boutons Actions - */ + */ if ($action != 'presend') { print '
'; @@ -2216,7 +2193,7 @@ else /* * Documents generes - */ + */ $filename=dol_sanitizeFileName($object->ref); $filedir=$conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5d7f493f2cf..b03d67f1701 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1710,7 +1710,7 @@ class Propal extends CommonObject { if ($statut == 2) { - // Classe la societe rattachee comme client + // Classe la société rattachée comme client $soc=new Societe($this->db); $soc->id = $this->socid; $result=$soc->set_as_client(); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 61ad0aac194..0f2925cf455 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -21,7 +21,7 @@ /** * \file htdocs/commande/document.php * \ingroup order - * \brief Page de gestion des documents attachees a une commande + * \brief Documents setup page attached to an order */ require '../main.inc.php'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 737e31cca7f..697d47c78bf 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1179,12 +1179,11 @@ else if ($action == 'update_extras') { // Fill array 'array_options' with data from update form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if($ret < 0) $error++; - if($ret < 0) - $error++; - - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('orderdao')); @@ -1192,22 +1191,16 @@ else if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } - else - { - $action = 'edit_extras'; - } - + + if ($error) $action = 'edit_extras'; } /* @@ -2208,20 +2201,12 @@ else print ''; } - // Other attributes + // Other attributes (TODO Move this into an include) $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { @@ -2244,35 +2229,27 @@ else $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->commande->creer) + if ($action == 'edit_extras' && $user->rights->commande->creer && GETPOST('attribute') == $key) { + print ''; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + print ''; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->commande->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->commande->creer) - { - print '
'; - - } - else { - if ($object->statut == 0 && $user->rights->commande->creer) - { - print ''; - } - } - } } $rowspan=4; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a2c9dc80594..191d48c4fdf 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1926,11 +1926,11 @@ if ($action == 'update_extras') { // Fill array 'array_options' with data from add form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - if($ret < 0) - $error++; + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + if ($ret < 0) $error++; - if(!$error) { + if (! $error) + { // Actions on extra fields (by external module or standard code) // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('invoicedao')); @@ -1938,22 +1938,16 @@ if ($action == 'update_extras') $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result=$object->insertExtraFields(); + if ($result < 0) { - $result=$object->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } else if ($reshook < 0) $error++; } - else - { - $action = 'edit_extras'; - } - + + if ($error) $action = 'edit_extras'; } @@ -3413,21 +3407,13 @@ else if ($id > 0 || ! empty($ref)) print ''; } - // Other attributes + // Other attributes (TODO Move this into an include) $res=$object->fetch_optionals($object->id,$extralabels); $parameters=array('colspan' => ' colspan="2"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { - if ($action == 'edit_extras') - { - print ''; - print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { @@ -3450,35 +3436,27 @@ else if ($id > 0 || ! empty($ref)) $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->facture->creer) + if ($action == 'edit_extras' && $user->rights->facture->creer && GETPOST('attribute') == $key) { + print ''; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + print ''; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->facture->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->facture->creer) - { - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->facture->creer) - { - print ''; - } - } - } } print '
'; - print ''; - print ''; - print '
'.img_picto('','edit').' '.$langs->trans('Modify').'
'; - print ''; - print ''; - print '
'.img_picto('','edit').' '.$langs->trans('Modify').'

'; diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index a44d67d87a9..0efcb94d079 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -146,7 +146,9 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; + $langs->load("members"); + + print "
"; print_titre($langs->trans("FieldEdition", $attrname)); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index d040de378f2..a8c5b5f019c 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -26,10 +26,8 @@ /** - * \class LignePrelevement - * \brief Classe permettant la gestion des prelevements + * Class to manage withdrawals */ - class LignePrelevement { var $id; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 1a1049c8bcc..ef2cfba8480 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -5,7 +5,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2013 Florian Henry + * 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 @@ -62,6 +63,7 @@ class Contact extends CommonObject var $code; var $email; + var $skype; var $phone_pro; var $phone_perso; var $phone_mobile; @@ -226,6 +228,7 @@ class Contact extends CommonObject $this->phone_perso=trim($this->phone_perso); $this->phone_mobile=trim($this->phone_mobile); $this->jabberid=trim($this->jabberid); + $this->skype=trim($this->skype); $this->fax=trim($this->fax); $this->zip=(empty($this->zip)?'':$this->zip); $this->town=(empty($this->town)?'':$this->town); @@ -249,6 +252,7 @@ class Contact extends CommonObject $sql .= ", poste='".$this->db->escape($this->poste)."'"; $sql .= ", fax='".$this->db->escape($this->fax)."'"; $sql .= ", email='".$this->db->escape($this->email)."'"; + $sql .= ", skype='".$this->db->escape($this->skype)."'"; $sql .= ", note_private = ".(isset($this->note_private)?"'".$this->db->escape($this->note_private)."'":"null"); $sql .= ", note_public = ".(isset($this->note_public)?"'".$this->db->escape($this->note_public)."'":"null"); $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); @@ -379,6 +383,7 @@ class Contact extends CommonObject if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->skype && ! empty($conf->global->LDAP_CONTACT_FIELD_SKYPE)) $info[$conf->global->LDAP_CONTACT_FIELD_SKYPE] = $this->skype; if ($this->note_private && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note_private; if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; @@ -494,7 +499,7 @@ class Contact extends CommonObject $sql.= " c.fk_pays as country_id,"; $sql.= " c.fk_departement,"; $sql.= " c.birthday,"; - $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,"; + $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.import_key,"; $sql.= " p.libelle as country, p.code as country_code,"; @@ -549,6 +554,7 @@ class Contact extends CommonObject $this->email = $obj->email; $this->jabberid = $obj->jabberid; + $this->skype = $obj->skype; $this->priv = $obj->priv; $this->mail = $obj->email; @@ -947,24 +953,24 @@ class Contact extends CommonObject } elseif ($mode == 2) { - if ($statut==0) return img_picto($langs->trans('Disabled'),'statut1').' '.$langs->trans('Disabled'); + if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); } elseif ($mode == 3) { - if ($statut==0) return img_picto($langs->trans('Disabled'),'statut1'); + if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5'); elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4'); } elseif ($mode == 4) { - if ($statut==0) return img_picto($langs->trans('Disabled'),'statut1').' '.$langs->trans('StatusContactDraft'); + if ($statut==0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('StatusContactDraft'); elseif ($statut==1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); } elseif ($mode == 5) { - if ($statut==0) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut1'); + if ($statut==0) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); elseif ($statut==1) return ''.$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); } @@ -1025,6 +1031,7 @@ class Contact extends CommonObject $this->country_code = 'FR'; $this->country = 'France'; $this->email = 'specimen@specimen.com'; + $this->skype = 'tom.hanson'; $this->phone_pro = '0909090901'; $this->phone_perso = '0909090902'; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index fb30b32a67d..3334a12b069 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2013 Florian Henry + * 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 @@ -168,13 +169,14 @@ if (empty($reshook)) $object->town = $_POST["town"]; $object->country_id = $_POST["country_id"]; $object->state_id = $_POST["state_id"]; + $object->skype = $_POST["skype"]; $object->email = $_POST["email"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; $object->fax = $_POST["fax"]; $object->jabberid = $_POST["jabberid"]; - $object->no_email = $_POST["no_email"]; + $object->no_email = $_POST["no_email"]; $object->priv = $_POST["priv"]; $object->note_public = GETPOST("note_public"); $object->note_private = GETPOST("note_private"); @@ -268,6 +270,7 @@ if (empty($reshook)) $object->country_id = $_POST["country_id"]; $object->email = $_POST["email"]; + $object->skype = $_POST["skype"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; $object->phone_mobile = $_POST["phone_mobile"]; @@ -514,7 +517,7 @@ else print ''.$langs->trans("No_Email").''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).''; } else - { + { print ' '; } print ''; @@ -522,6 +525,12 @@ else // Instant message and no email print ''.$langs->trans("IM").'jabberid).'">'; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").'skype).'">'; + } + // Visibility print ''.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -712,7 +721,7 @@ else print ''; // Jabberid - print 'Jabberidjabberid).'">'; + print ''.$langs->trans("Jabberid").'jabberid).'">'; if (! empty($conf->mailing->enabled)) { print ''.$langs->trans("No_Email").''.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).''; @@ -722,7 +731,13 @@ else print ' '; } print ''; - + + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").'skype).'">'; + } + // Visibility print ''.$langs->trans("ContactVisibility").''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -935,6 +950,12 @@ else print ' '; } print ''; + + // Skype + if (!empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).''; + } print ''.$langs->trans("ContactVisibility").''; print $object->LibPubPriv($object->priv); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 529b9cb69b9..dcaf4aaac4b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Raphaël Doursenaud * Copyright (C) 2013 Cédric Salvador + * 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 @@ -48,6 +49,7 @@ $search_phonepro=GETPOST("search_phonepro"); $search_phonemob=GETPOST("search_phonemob"); $search_fax=GETPOST("search_fax"); $search_email=GETPOST("search_email"); +$search_skype=GETPOST("search_skype"); $search_priv=GETPOST("search_priv"); $search_categ = GETPOST("search_categ",'int'); $search_statut=GETPOST("search_statut"); @@ -99,6 +101,7 @@ if (GETPOST('button_removefilter')) $search_phonemob=""; $search_fax=""; $search_email=""; + $search_skype=""; $search_priv=""; $sall=""; } @@ -117,7 +120,7 @@ $form=new Form($db); $formother=new FormOther($db); $sql = "SELECT s.rowid as socid, s.nom as name,"; -$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email,"; +$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; $sql.= " cp.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; @@ -185,6 +188,10 @@ if (strlen($search_email)) // filtre sur l'email { $sql .= " AND p.email LIKE '%".$db->escape($search_email)."%'"; } +if (strlen($search_skype)) // filtre sur skype +{ + $sql .= " AND p.skype LIKE '%".$db->escape($search_skype)."%'"; +} if ($type == "o") // filtre sur type { $sql .= " AND p.fk_soc IS NULL"; @@ -281,6 +288,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); } 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); @@ -316,6 +324,12 @@ if ($result) print ''; print ''; print ''; + if (! empty($conf->skype->enabled)) + { + print ''; + print ''; + print ''; + } print ' '; print ''; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -376,7 +390,9 @@ if ($result) print ''.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''; // 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).''; } + // Date print ''.dol_print_date($db->jdate($obj->tms),"day").''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b3e5f8f47d8..a3ddb70e5f6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,14 +1,11 @@ * Copyright (C) 2005-2013 Regis Houssin -<<<<<<< HEAD * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel -======= * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel ->>>>>>> refs/remotes/origin/3.4 - * Copyright (C) 2011-2012 Philippe Grand + * Copyright (C) 2011-2012 Philippe Grand * Copyright (C) 2012 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -2142,10 +2139,12 @@ abstract class CommonObject */ function insertExtraFields() { - global $langs; + global $conf,$langs; $error=0; + if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used + if (! empty($this->array_options)) { // Check parameters @@ -2249,7 +2248,7 @@ abstract class CommonObject $out = ''; - if(count($extrafields->attribute_label) > 0) + if (count($extrafields->attribute_label) > 0) { $out .= "\n"; $out .= ' '; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c651603451d..b26b050dfd4 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -688,54 +688,53 @@ class ExtraFields { $param_list=array_keys($param['options']); $InfoFieldList = explode(":", $param_list[0]); + // 0 : tableName + // 1 : label field name + // 2 : key fields name (if differ of rowid) + // 3 : key field parent (for dependent lists) + // 4 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value + $keyList=(empty($InfoFieldList[2])?'rowid':$InfoFieldList[2].' as rowid'); - // 0 1 : tableName - // 1 2 : label field name Nom du champ contenant le libelle - // 2 3 : key fields name (if differ of rowid) - // 3 4 : key field parent (for dependent lists) - // 4 5 : where clause filter on column or table extrafield, syntax field='value' or extra.field=value - - - $keyList='rowid'; - - if (count($InfoFieldList)>=3) { + if (count($InfoFieldList) > 3 && ! empty($InfoFieldList[3])) + { list($parentName, $parentField) = explode('|', $InfoFieldList[3]); $keyList.= ', '.$parentField; } - if (count($InfoFieldList)>=4 && !empty($InfoFieldList[4])) { - if (strpos($InfoFieldList[4], 'extra')!==false) { + if (count($InfoFieldList) > 4 && ! empty($InfoFieldList[4])) + { + if (strpos($InfoFieldList[4], 'extra.') !== false) + { $keyList='main.'.$InfoFieldList[2].' as rowid'; - }else { + } else { $keyList=$InfoFieldList[2].' as rowid'; } } - $fields_label = explode('|',$InfoFieldList[1]); - if(is_array($fields_label)) { - $keyList .=', '; - $keyList .= implode(', ', $fields_label); - } - - $fields_label = explode('|',$InfoFieldList[1]); - if(is_array($fields_label)) { + if (is_array($fields_label)) + { $keyList .=', '; $keyList .= implode(', ', $fields_label); } + $sqlwhere=''; $sql = 'SELECT '.$keyList; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - if (!empty($InfoFieldList[4])) { - + if (!empty($InfoFieldList[4])) + { //We have to join on extrafield table - if (strpos($InfoFieldList[4], 'extra')!==false) { + if (strpos($InfoFieldList[4], 'extra')!==false) + { $sql.= ' as main, '.MAIN_DB_PREFIX .$InfoFieldList[0].'_extrafields as extra'; - $sql.= ' WHERE extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; - }else { - $sql.= ' WHERE '.$InfoFieldList[4]; + $sqlwhere.= ' AND extra.fk_object=main.'.$InfoFieldList[2]. ' AND '.$InfoFieldList[4]; + } + else + { + $sqlwhere.= ' AND '.$InfoFieldList[4]; } } - //$sql.= ' WHERE entity = '.$conf->entity; + if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it. + $sql.=preg_replace('/^ AND /','',$sqlwhere); //print $sql; dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql); @@ -807,6 +806,9 @@ class ExtraFields } $this->db->free($resql); } + else { + print 'Error in request '.$sql.' '.$this->db->lasterror().'. Check setup of extra parameters.
'; + } } $out.=''; } @@ -1005,13 +1007,14 @@ class ExtraFields } /** - * Fill array_options array for object by extrafields value (using for data send by forms) + * Fill array_options property of object by extrafields value (using for data sent by forms) * * @param array $extralabels $array of extrafields - * @param object &$object object + * @param object &$object Object + * @param string $onlykey Only following key is filled * @return int 1 if array_options set / 0 if no value */ - function setOptionalsFromPost($extralabels,&$object) + function setOptionalsFromPost($extralabels,&$object,$onlykey='') { global $_POST, $langs; $nofillrequired='';// For error when required field left blank @@ -1022,6 +1025,8 @@ class ExtraFields // Get extra fields foreach ($extralabels as $key => $value) { + if (! empty($onlykey) && $key != $onlykey) continue; + $key_type = $this->attribute_type[$key]; if($this->attribute_required[$key] && !GETPOST("options_$key",2)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index dc8ca8a30be..3ba7fee84c4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3664,7 +3664,7 @@ class Form * @param string $typehour if 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @return void */ - function select_duration($prefix,$iSecond='',$disabled=0,$typehour='select') + function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select') { global $langs; @@ -3680,7 +3680,7 @@ class Form if ($typehour=='select') { print ''; - print ''; - print ''; - } - foreach($extrafields->attribute_label as $key=>$label) { if ($action == 'edit_extras') { @@ -1319,35 +1278,27 @@ else if ($id > 0 || ! empty($ref)) { $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } - if ($action == 'edit_extras' && $user->rights->ficheinter->creer) + if ($action == 'edit_extras' && $user->rights->ficheinter->creer && GETPOST('attribute') == $key) { + print '
'; + print ''; + print ''; + print ''; + print ''; + print $extrafields->showInputField($key,$value); + + print ''; + print '
'; } else { print $extrafields->showOutputField($key,$value); + if ($object->statut == 0 && $user->rights->ficheinter->creer) print ''.img_picto('','edit').' '.$langs->trans('Modify').''; } print ''."\n"; } } - - if(count($extrafields->attribute_label) > 0) { - - if ($action == 'edit_extras' && $user->rights->ficheinter->creer) - { - print ''; - print ''; - print ''; - print ''; - - } - else { - if ($object->statut == 0 && $user->rights->ficheinter->creer) - { - print ''.img_picto('','edit').' '.$langs->trans('Modify').''; - } - } - } } print "
"; diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index 957f4b315ce..b3bc8295d2c 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -1,6 +1,6 @@ - * Copyright (C) 2009-2010 Laurent Destailleur + * Copyright (C) 2009-2013 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -31,32 +31,36 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; $langs->load('companies'); $langs->load("interventions"); -$fichinterid = GETPOST('id','int'); +$id = GETPOST('id','int'); // Security check if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter'); +$object = new Fichinter($db); + +if ($id > 0) +{ + $object->fetch($id); +} + /* -* View -*/ + * View + */ llxHeader(); -$fichinter = new Fichinter($db); -$fichinter->fetch($fichinterid); - $societe = new Societe($db); -$societe->fetch($fichinter->socid); +$societe->fetch($object->socid); -$head = fichinter_prepare_head($fichinter); +$head = fichinter_prepare_head($object); dol_fiche_head($head, 'info', $langs->trans('InterventionCard'), 0, 'intervention'); -$fichinter->info($fichinter->id); +$object->info($object->id); print '
'; -dol_print_object_info($fichinter); +dol_print_object_info($object); print '
'; print '
'; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6f6f9e91867..467a59adba1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -355,7 +355,7 @@ class CommandeFournisseur extends CommonOrder if (preg_match('/^[\(]?PROV/i', $this->ref)) { // On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref) - // afin de ne pas perdre les fichiers attaches + // in order not to lose the attached files $oldref = dol_sanitizeFileName($this->ref); $newref = dol_sanitizeFileName($num); $dirsource = $conf->fournisseur->dir_output.'/commande/'.$oldref; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2e8269055ea..a237ef49a5f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -897,7 +897,7 @@ class FactureFournisseur extends CommonInvoice if (preg_match('/^[\(]?PROV/i', $this->ref)) { // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref) - // afin de ne pas perdre les fichiers attaches + // in order not to lose the attached files $facref = dol_sanitizeFileName($this->ref); $snumfa = dol_sanitizeFileName($num); diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index da72a325574..63c5a43f912 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -22,7 +22,7 @@ /** * \file htdocs/fourn/commande/document.php * \ingroup supplier - * \brief Page de gestion des documents attachees a une commande fournisseur + * \brief Page de gestion des documents attaches a une commande fournisseur */ require '../../main.inc.php'; diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 12daf37060c..d75b81f402a 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -21,7 +21,7 @@ /** * \file htdocs/fourn/facture/document.php * \ingroup facture, fournisseur - * \brief Page de gestion des documents attachees a une facture fournisseur + * \brief Page de gestion des documents attaches a une facture fournisseur */ require '../../main.inc.php'; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 27beceeb979..9f3b32166dc 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -99,8 +99,6 @@ if ($object->fetch($id)) print '
'; - //print ''; - //print ''; print ''; print ''; print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 89776835e2a..7bc1ac8fef1 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -618,7 +618,7 @@ abstract class ActionsCardCommon } else { - $this->tpl['linked_member'] = $langs->trans("UserNotLinkedToMember"); + $this->tpl['linked_member'] = $langs->trans("ThirdpartyNotLinkedToMember"); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 96863a078d8..a7d4ce2e850 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2013 Florian Henry + * 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 @@ -68,6 +69,7 @@ class Societe extends CommonObject var $phone; var $fax; var $email; + var $skype; var $url; //! barcode @@ -410,6 +412,7 @@ class Societe extends CommonObject $this->fax = preg_replace("/\s/","",$this->fax); $this->fax = preg_replace("/\./","",$this->fax); $this->email = trim($this->email); + $this->skype = trim($this->skype); $this->url = $this->url?clean_url($this->url,0):''; $this->idprof1 = trim($this->idprof1); $this->idprof2 = trim($this->idprof2); @@ -508,6 +511,7 @@ class Societe extends CommonObject $sql .= ",phone = ".(! empty($this->phone)?"'".$this->db->escape($this->phone)."'":"null"); $sql .= ",fax = ".(! empty($this->fax)?"'".$this->db->escape($this->fax)."'":"null"); $sql .= ",email = ".(! empty($this->email)?"'".$this->db->escape($this->email)."'":"null"); + $sql .= ",skype = ".(! empty($this->skype)?"'".$this->db->escape($this->skype)."'":"null"); $sql .= ",url = ".(! empty($this->url)?"'".$this->db->escape($this->url)."'":"null"); $sql .= ",siren = '". $this->db->escape($this->idprof1) ."'"; @@ -590,6 +594,7 @@ class Societe extends CommonObject //$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged $lmember->address=$this->address; $lmember->email=$this->email; + $lmember->skype=$this->skype; $lmember->phone=$this->phone; $result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates @@ -699,7 +704,7 @@ class Societe extends CommonObject $sql .= ', s.status'; $sql .= ', s.price_level'; $sql .= ', s.tms as date_update'; - $sql .= ', s.phone, s.fax, s.email, s.url, s.zip, s.town, s.note_private, s.note_public, s.client, s.fournisseur'; + $sql .= ', s.phone, s.fax, s.email, s.skype, s.url, s.zip, s.town, s.note_private, s.note_public, s.client, s.fournisseur'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; @@ -777,6 +782,7 @@ class Societe extends CommonObject $this->statut_commercial = $libelle; // libelle statut commercial $this->email = $obj->email; + $this->skype = $obj->skype; $this->url = $obj->url; $this->phone = $obj->phone; $this->fax = $obj->fax; @@ -1518,22 +1524,22 @@ class Societe extends CommonObject } if ($mode == 2) { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut8').' '.$langs->trans("ActivityCeased"); + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5').' '.$langs->trans("ActivityCeased"); if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity"); } if ($mode == 3) { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut8'); + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5'); if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4'); } if ($mode == 4) { - if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut8').' '.$langs->trans("ActivityCeased"); + if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut5').' '.$langs->trans("ActivityCeased"); if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity"); } if ($mode == 5) { - if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut8'); + if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut5'); if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4'); } } @@ -2409,6 +2415,7 @@ class Societe extends CommonObject $this->country_id=$member->country_id; $this->phone=$member->phone; // Prof phone $this->email=$member->email; + $this->skype=$member->skype; $this->client = 1; // A member is a customer by default $this->code_client = -1; @@ -2548,6 +2555,7 @@ class Societe extends CommonObject $this->country_id=1; $this->country_code='FR'; $this->email='specimen@specimen.com'; + $this->skype='tom.hanson'; $this->url='http://www.specimen.com'; $this->phone='0909090901'; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index fb273b79ab3..9001894c149 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -4,8 +4,10 @@ * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2008 Patrick Raguin + * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2013 Juanjo Menent + * Copyright (C) 2011-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 @@ -130,6 +132,7 @@ if (empty($reshook)) $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id'); $object->state_id = GETPOST('state_id'); + $object->skype = GETPOST('skype'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -254,7 +257,7 @@ if (empty($reshook)) dol_syslog("This thirdparty is a personal people",LOG_DEBUG); $contact=new Contact($db); - $contact->civilite_id = $object->civilite_id; + $contact->civilite_id = $object->civilite_id; $contact->name = $object->name_bis; $contact->firstname = $object->firstname; $contact->address = $object->address; @@ -265,8 +268,9 @@ if (empty($reshook)) $contact->socid = $object->id; // fk_soc $contact->status = 1; $contact->email = $object->email; - $contact->phone_pro = $object->phone; - $contact->fax = $object->fax; + $contact->skype = $object->skype; + $contact->phone_pro = $object->phone; + $contact->fax = $object->fax; $contact->priv = 0; $result=$contact->create($user); @@ -598,6 +602,7 @@ else $object->zip = GETPOST('zipcode'); $object->town = GETPOST('town'); $object->state_id = GETPOST('state_id'); + $object->skype = GETPOST('skype'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -845,6 +850,12 @@ else print ''; print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Phone / Fax print ''; print ''; @@ -1079,6 +1090,7 @@ else $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id; $object->state_id = GETPOST('state_id'); + $object->skype = GETPOST('skype'); $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); @@ -1088,8 +1100,8 @@ else $object->idprof2 = GETPOST('idprof2'); $object->idprof3 = GETPOST('idprof3'); $object->idprof4 = GETPOST('idprof4'); - $object->idprof5 = GETPOST('idprof5'); - $object->idprof6 = GETPOST('idprof6'); + $object->idprof5 = GETPOST('idprof5'); + $object->idprof6 = GETPOST('idprof6'); $object->typent_id = GETPOST('typent_id'); $object->effectif_id = GETPOST('effectif_id'); $object->barcode = GETPOST('barcode'); @@ -1261,7 +1273,13 @@ else // EMail / Web print ''; print ''; - + + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Phone / Fax print ''; print ''; @@ -1569,6 +1587,14 @@ else print ''; + + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } // Phone / Fax print ''; @@ -1767,7 +1793,7 @@ else } else { - print $langs->trans("UserNotLinkedToMember"); + print $langs->trans("ThirdpartyNotLinkedToMember"); } print ''; print "\n"; diff --git a/htdocs/theme/amarok/img/object_skype.png b/htdocs/theme/amarok/img/object_skype.png new file mode 100644 index 00000000000..97121565bb0 Binary files /dev/null and b/htdocs/theme/amarok/img/object_skype.png differ diff --git a/htdocs/theme/auguria/img/object_skype.png b/htdocs/theme/auguria/img/object_skype.png new file mode 100644 index 00000000000..97121565bb0 Binary files /dev/null and b/htdocs/theme/auguria/img/object_skype.png differ diff --git a/htdocs/theme/bureau2crea/img/object_skype.png b/htdocs/theme/bureau2crea/img/object_skype.png new file mode 100644 index 00000000000..97121565bb0 Binary files /dev/null and b/htdocs/theme/bureau2crea/img/object_skype.png differ diff --git a/htdocs/theme/cameleo/img/object_skype.png b/htdocs/theme/cameleo/img/object_skype.png new file mode 100644 index 00000000000..97121565bb0 Binary files /dev/null and b/htdocs/theme/cameleo/img/object_skype.png differ diff --git a/htdocs/theme/eldy/img/object_skype.png b/htdocs/theme/eldy/img/object_skype.png new file mode 100644 index 00000000000..97121565bb0 Binary files /dev/null and b/htdocs/theme/eldy/img/object_skype.png differ
'; print ''; print ''; print "\n"; @@ -273,7 +271,6 @@ if ($object->fetch($id)) print '
'; - //print '
'; - //print '
'.$langs->trans("ThirdPartyName").''; @@ -263,7 +261,7 @@ if ($object->fetch($id)) } else { - print $langs->trans("UserNotLinkedToMember"); + print $langs->trans("ThirdpartyNotLinkedToMember"); } print '
'; $var=true; @@ -428,8 +425,6 @@ if ($object->fetch($id)) print ''; print '
'; - //print '
' . "\n"; dol_fiche_end(); diff --git a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql index 75614321fbc..9c317efb6e4 100755 --- a/htdocs/install/mysql/migration/3.4.0-3.5.0.sql +++ b/htdocs/install/mysql/migration/3.4.0-3.5.0.sql @@ -331,3 +331,9 @@ create table llx_actioncomm_resources ) ENGINE=innodb; ALTER TABLE llx_actioncomm_resources ADD UNIQUE INDEX idx_actioncomm_resources_idx1 (fk_actioncomm, element_type, fk_element); ALTER TABLE llx_actioncomm_resources ADD INDEX idx_actioncomm_resources_fk_element (fk_element); + +-- Task 157 +ALTER TABLE llx_user ADD skype VARCHAR(255) AFTER job; +ALTER TABLE llx_socpeople ADD skype VARCHAR(255) AFTER jabberid; +ALTER TABLE llx_societe ADD skype VARCHAR(255) AFTER email; +ALTER TABLE llx_adherent ADD skype VARCHAR(255) AFTER email; diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index af15f5da198..6d5a4723462 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -45,6 +45,7 @@ create table llx_adherent state_id integer, country integer, email varchar(255), + skype varchar(255), phone varchar(30), phone_perso varchar(30), phone_mobile varchar(30), diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index e0588f04794..f4e1614cd7d 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -49,6 +49,7 @@ create table llx_societe fax varchar(20), -- fax number url varchar(255), -- email varchar(128), -- + skype varchar(255), -- fk_effectif integer DEFAULT 0, -- fk_typent integer DEFAULT 0, -- fk_forme_juridique integer DEFAULT 0, -- juridical status diff --git a/htdocs/install/mysql/tables/llx_socpeople.sql b/htdocs/install/mysql/tables/llx_socpeople.sql index 00e6f50f61b..04635061e59 100644 --- a/htdocs/install/mysql/tables/llx_socpeople.sql +++ b/htdocs/install/mysql/tables/llx_socpeople.sql @@ -42,6 +42,7 @@ create table llx_socpeople fax varchar(30), email varchar(255), jabberid varchar(255), + skype varchar(255), no_email smallint NOT NULL DEFAULT 0, priv smallint NOT NULL DEFAULT 0, fk_user_creat integer DEFAULT 0, -- user qui a creel'enregistrement diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 9fd1db59c91..2bd8523b278 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -41,6 +41,7 @@ create table llx_user fk_state integer DEFAULT 0, -- fk_country integer DEFAULT 0, -- job varchar(128), + skype varchar(255), office_phone varchar(20), office_fax varchar(20), user_mobile varchar(20), diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8e73c2fe560..b9b5de0abb3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -972,6 +972,8 @@ ExtraFieldsThirdParties=Complementary attributes (thirdparty) ExtraFieldsContacts=Complementary attributes (contact/address) ExtraFieldsMember=Complementary attributes (member) ExtraFieldsMemberType=Complementary attributes (member type) +ExtraFieldsCustomerOrders=Complementary attributes (orders) +ExtraFieldsCustomerInvoices=Complementary attributes (invoices) ExtraFieldsSupplierOrders=Complementary attributes (orders) ExtraFieldsSupplierInvoices=Complementary attributes (invoices) ExtraFieldsProject=Complementary attributes (projects) @@ -1003,6 +1005,7 @@ BrowserIsKO=You are using the web browser %s. This browser is known to be a bad XDebugInstalled=XDebug est chargé. XCacheInstalled=XCache is loaded. AddRefInList=Display customer/supplier ref into list (select list or combobox) and most of hyperlink +FieldEdition=Edition of field %s ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. PasswordGenerationNone=Do not suggest any generated password. Password must be type in manually. diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 2f9e4ed285d..94e6cb840c5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -66,6 +66,8 @@ Country=Country CountryCode=Country code CountryId=Country id Phone=Phone +Skype=Skype +Call=Call PhonePro=Prof. phone PhonePerso=Pers. phone PhoneMobile=Mobile diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index ec925209b2c..5c12d9c3aa3 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -8,6 +8,7 @@ Members=Members MemberAccount=Member login ShowMember=Show member card UserNotLinkedToMember=User not linked to a member +ThirdpartyNotLinkedToMember=Third-party not linked to a member MembersTickets=Members Tickets FundationMembers=Foundation members Attributs=Attributes @@ -118,7 +119,6 @@ LastMembers=Last %s members LastMembersModified=Last %s modified members LastSubscriptionsModified=Last %s modified subscriptions AttributeName=Attribute name -FieldEdition=Edition of field %s String=String Text=Text Int=Int diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 58df5bf983b..8d73250d652 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -972,7 +972,10 @@ ExtraFieldsThirdParties=Attributs supplémentaires (tiers) ExtraFieldsContacts=Attributs supplémentaires (contacts/adresses) ExtraFieldsMember=Attributs supplémentaires (adhérents) ExtraFieldsMemberType=Attributs supplémentaires (type d'adhérents) +ExtraFieldsCustomerOrders=Attributs supplémentaires (commandes) +ExtraFieldsCustomerInvoices=Attributs supplémentaires (factures) ExtraFieldsSupplierOrders=Attributs supplémentaires (commandes) +ExtraFieldsCustomerInvoices=Attributs supplémentaires (factures clients) ExtraFieldsSupplierInvoices=Attributs supplémentaires (factures) ExtraFieldsProject=Attributs supplémentaires (projets) ExtraFieldsProjectTask=Attributs supplémentaires (tâches) @@ -1015,6 +1018,7 @@ EncryptedPasswordInDatabase=Permettre le chiffrement des mots de passe dans la b DisableForgetPasswordLinkOnLogonPage=Ne pas afficher le lien "Mot de passe oublié" sur la page de connexion UsersSetup=Configuration du module utilisateurs UserMailRequired=Email requis pour créer un nouvel utilisateur +FieldEdition=Édition du champ %s ##### Company setup ##### CompanySetup=Configuration du module Tiers CompanyCodeChecker=Modèle de génération et contrôle des codes tiers (clients/fournisseurs) @@ -1467,8 +1471,8 @@ TestGeoIPResult=Test de conversion IP -> Pays ProjectsNumberingModules=Modèles de numérotation des références projets ProjectsSetup=Configuration du module Projets ProjectsModelModule=Modèles de document de rapport projets -TasksNumberingModules=Modèles de numérotation des références taches -TaskModelModule=Modèles de document de rapport taches +TasksNumberingModules=Modèles de numérotation des références tâches +TaskModelModule=Modèles de document de rapport tâches ##### ECM (GED) ##### ECMSetup = Configuration du module GED ECMAutoTree = L'arborescence automatique est disponible diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 32546eac28c..d4e10c80fca 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -68,7 +68,7 @@ CronPriority=Priorité CronLabel=Description CronNbRun=Nb. exec. CronEach=Tous les -JobFinished=Tache lancée et terminée +JobFinished=Tâche lancée et terminée # #Page card diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 4b1c8b8d28b..92a06886712 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -8,6 +8,7 @@ Members=Adhérents MemberAccount=Login adhérent ShowMember=Afficher fiche adhérent UserNotLinkedToMember=Utilisateur non lié à un adhérent +ThirdpartyNotLinkedToMember=Tiers non lié à un adhérent MembersTickets=Étiquettes d'adhérents FundationMembers=Membres de l'association Attributs=Attributs @@ -118,7 +119,6 @@ LastMembers=Les %s derniers adhérents LastMembersModified=Les %s derniers adhérents modifiés LastSubscriptionsModified=Les %s dernières adhésions modifiées AttributeName=Nom de l'attribut -FieldEdition=Édition du champ %s String=Chaîne Text=Texte long Int=Numérique diff --git a/htdocs/projet/activity/list.php b/htdocs/projet/activity/list.php index 5d5eacfcbda..e9cb8568b65 100644 --- a/htdocs/projet/activity/list.php +++ b/htdocs/projet/activity/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois * @@ -56,35 +56,42 @@ if ($action == 'addtime' && $user->rights->projet->creer) { $task = new Task($db); - $timespent_duration=0; + $timespent_duration=array(); foreach($_POST as $key => $time) { - if(intval($time)>0) + if (intval($time) > 0) { // Hours or minutes - if(preg_match("/([0-9]+)(hour|min)/",$key,$matches)) + if (preg_match("/([0-9]+)(hour|min)/",$key,$matches)) { $id = $matches[1]; - - // We store HOURS in seconds - if($matches[2]=='hour') $timespent_duration += $time*60*60; - - // We store MINUTES in seconds - if($matches[2]=='min') $timespent_duration += $time*60; + if ($id > 0) + { + // We store HOURS in seconds + if($matches[2]=='hour') $timespent_duration[$id] += $time*60*60; + + // We store MINUTES in seconds + if($matches[2]=='min') $timespent_duration[$id] += $time*60; + } } } } - if ($timespent_duration > 0) + if (count($timespent_duration) > 0) { - $task->fetch($id); - $task->timespent_duration = $timespent_duration; - $task->timespent_fk_user = $user->id; - $task->timespent_date = dol_mktime(12,0,0,$_POST["{$id}month"],$_POST["{$id}day"],$_POST["{$id}year"]); - $task->addTimeSpent($user); - - // header to avoid submit twice on back + foreach($timespent_duration as $key => $val) + { + $task->fetch($key); + $task->timespent_duration = $val; + $task->timespent_fk_user = $user->id; + $task->timespent_date = dol_mktime(12,0,0,$_POST["{$key}month"],$_POST["{$key}day"],$_POST["{$key}year"]); + $task->addTimeSpent($user); + } + + setEventMessage($langs->trans("RecordSaved")); + + // Redirect to avoid submit twice on back header('Location: '.$_SERVER["PHP_SELF"].'?id='.$projectid.($mode?'&mode='.$mode:'')); exit; } @@ -144,6 +151,7 @@ print '
'.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("DateStart").''.$langs->trans("DateEnd").''.$langs->trans("PlannedWorkload").''.$langs->trans("Progress").''.$langs->trans("TimeSpent").''.$langs->trans("AddDuration").'
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Phone').''.$langs->trans('Fax').'
'.$langs->trans('Web').''; print dol_print_url($object->url); print '
'.$langs->trans('Skype').''; + print dol_print_skype($object->skype,0,$object->id,'AC_SKYPE'); + print '
'.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').'