diff --git a/dev/skeletons/skeleton_script.php b/dev/skeletons/skeleton_script.php index 2a49a45b833..38a68a73ed3 100644 --- a/dev/skeletons/skeleton_script.php +++ b/dev/skeletons/skeleton_script.php @@ -1,6 +1,6 @@ #!/usr/bin/php +/* Copyright (C) 2007-2013 Laurent Destailleur * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -19,7 +19,7 @@ /** * \file dev/skeletons/skeleton_script.php - * \ingroup mymodule othermodule1 othermodule2 + * \ingroup mymodule * \brief This file is an example for a command line script * Put here some comments */ @@ -34,19 +34,22 @@ if (substr($sapi_type, 0, 3) == 'cgi') { exit; } -// Global variables -$version='1.29'; +// Init global variables +$version='1.0'; $error=0; // -------------------- START OF YOUR CODE HERE -------------------- -// Include Dolibarr environment +@set_time_limit(0); // No timeout for this script +define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only". + +// Include and load Dolibarr environment variables require_once($path."../../htdocs/master.inc.php"); -// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file. +// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file). +// $user is created but empty. //$langs->setDefaultLang('en_US'); // To change default language of $langs $langs->load("main"); // To load language file for default language -@set_time_limit(0); // No timeout for this script // Load user and its permissions $result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. @@ -158,7 +161,7 @@ else $db->rollback(); } -$db->close(); // Close database opened handler +$db->close(); // Close $db database opened handler return $error; ?> diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 91bbbb33049..62f89f992dd 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -239,7 +239,7 @@ form_constantes($constantes); print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, '; +print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; print '%YEAR%, %MONTH%, %DAY%'; print '
'; @@ -257,7 +257,7 @@ form_constantes($constantes); print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, '; +print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; print '%YEAR%, %MONTH%, %DAY%'; print '
'; @@ -287,7 +287,7 @@ form_constantes($constantes); print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, '; -print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%, '; +print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, '; //print '%YEAR%, %MONTH%, %DAY%'; // Not supported print '
'; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 7c1d95502ca..e60a76bd936 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -62,7 +62,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg // requete en prenant que les adherents a jour de cotisation $sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,"; - $sql.= " d.address, d.zip, d.town, d.country, d.naiss, d.email, d.photo,"; + $sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,"; $sql.= " t.libelle as type,"; $sql.= " p.code as country_code, p.libelle as country"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; @@ -101,7 +101,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg '%COUNTRY%'=>$objp->country, '%COUNTRY_CODE%'=>$objp->country_code, '%EMAIL%'=>$objp->email, - '%NAISS%'=>dol_print_date($objp->naiss,'day'), + '%BIRTH%'=>dol_print_date($objp->birth,'day'), '%TYPE%'=>$objp->type, '%YEAR%'=>$year, '%MONTH%'=>$month, diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 7dd0f5fbbd1..3527535809b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -77,7 +77,7 @@ class Adherent extends CommonObject var $datem; var $datefin; var $datevalid; - var $naiss; + var $birth; var $typeid; // Id type adherent var $type; // Libelle type adherent @@ -175,7 +175,7 @@ class Adherent extends CommonObject { global $conf,$langs; - $birthday = dol_print_date($this->naiss,'day'); + $birthday = dol_print_date($this->birth,'day'); $msgishtml = 0; if (dol_textishtml($text,1)) $msgishtml = 1; @@ -214,7 +214,7 @@ class Adherent extends CommonObject '%TOWN%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, '%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, - '%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, + '%BIRTH%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, '%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, '%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass, @@ -433,7 +433,7 @@ class Adherent extends CommonObject $sql.= ", statut=" .$this->statut; $sql.= ", fk_adherent_type=".$this->typeid; $sql.= ", morphy='".$this->morphy."'"; - $sql.= ", naiss=" .($this->naiss?"'".$this->db->idate($this->naiss)."'":"null"); + $sql.= ", birth=" .($this->birth?"'".$this->db->idate($this->birth)."'":"null"); if ($this->datefin) $sql.= ", datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre modifie que par effacement cotisation if ($this->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifie que par validation adherent $sql.= ", fk_user_mod=".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest @@ -1012,7 +1012,7 @@ class Adherent extends CommonObject $sql.= " d.datec as datec,"; $sql.= " d.tms as datem,"; $sql.= " d.datefin as datefin,"; - $sql.= " d.naiss as datenaiss,"; + $sql.= " d.birth as birthday,"; $sql.= " d.datevalid as datev,"; $sql.= " d.country,"; $sql.= " d.state_id,"; @@ -1079,7 +1079,7 @@ class Adherent extends CommonObject $this->datem = $this->db->jdate($obj->datem); $this->datefin = $this->db->jdate($obj->datefin); $this->datevalid = $this->db->jdate($obj->datev); - $this->naiss = $this->db->jdate($obj->datenaiss); + $this->birth = $this->db->jdate($obj->birthday); $this->note = $obj->note; $this->morphy = $obj->morphy; @@ -1739,7 +1739,7 @@ class Adherent extends CommonObject $this->phone_perso = '0999999998'; $this->phone_mobile = '0999999997'; $this->note='No comment'; - $this->naiss=time(); + $this->birth=time(); $this->photo=''; $this->public=1; $this->statut=0; @@ -1811,7 +1811,7 @@ class Adherent extends CommonObject if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; - if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); + if ($this->birth && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->birth,'dayhourldap'); if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 0159f5d93d5..787cad2664f 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -236,12 +236,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $datenaiss=''; - if (isset($_POST["naissday"]) && $_POST["naissday"] - && isset($_POST["naissmonth"]) && $_POST["naissmonth"] - && isset($_POST["naissyear"]) && $_POST["naissyear"]) + $birthdate=''; + if (isset($_POST["birthday"]) && $_POST["birthday"] + && isset($_POST["birthmonth"]) && $_POST["birthmonth"] + && isset($_POST["birthyear"]) && $_POST["birthyear"]) { - $datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); + $birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); } // Create new object @@ -267,7 +267,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->naiss = $datenaiss; + $object->birth = $birthdate; $object->typeid = $_POST["typeid"]; //$object->note = trim($_POST["comment"]); @@ -388,12 +388,12 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) if ($action == 'add' && $user->rights->adherent->creer) { if ($canvas) $object->canvas=$canvas; - $datenaiss=''; - if (isset($_POST["naissday"]) && $_POST["naissday"] - && isset($_POST["naissmonth"]) && $_POST["naissmonth"] - && isset($_POST["naissyear"]) && $_POST["naissyear"]) + $birthdate=''; + if (isset($_POST["birthday"]) && $_POST["birthday"] + && isset($_POST["birthmonth"]) && $_POST["birthmonth"] + && isset($_POST["birthyear"]) && $_POST["birthyear"]) { - $datenaiss=dol_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); + $birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); } $datecotisation=''; if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) @@ -442,7 +442,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->email = $email; $object->login = $login; $object->pass = $pass; - $object->naiss = $datenaiss; + $object->naiss = $birthdate; $object->photo = $photo; $object->typeid = $typeid; //$object->note = $comment; @@ -1113,9 +1113,9 @@ else // EMail print ''.($conf->global->ADHERENT_MAIL_REQUIRED?'':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'':'').'email).'">'; - // Date naissance + // Birthday print "".$langs->trans("Birthday")."\n"; - $form->select_date(($object->naiss ? $object->naiss : -1),'naiss','','',1,'formsoc'); + $form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc'); print "\n"; // Profil public @@ -1444,8 +1444,8 @@ else // EMail print ''.$langs->trans("EMail").''.dol_print_email($object->email,0,$object->fk_soc,1).''; - // Date naissance - print ''.$langs->trans("Birthday").''.dol_print_date($object->naiss,'day').''; + // Birthday + print ''.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').''; // Public print ''.$langs->trans("Public").''.yn($object->public).''; diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 7ec46475c6e..29af716ceb0 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -134,13 +134,14 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print "
\n"; -print $langs->trans("AgendaAutoActionDesc")."
\n"; -print "
\n"; $head=agenda_prepare_head(); dol_fiche_head($head, 'autoactions', $langs->trans("Agenda")); +print $langs->trans("AgendaAutoActionDesc")."
\n"; +print $langs->trans("OnlyActiveElementsAreShown").'
'; +print "
\n"; print '
'; print ''; @@ -179,8 +180,6 @@ print ''; print '
'; print ''; -print '     '; -print ''; print "
"; print "
\n"; @@ -226,12 +225,13 @@ else } print ''."\n"; +print ''; print "
"; dol_htmloutput_mesg($mesg); -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 1bd0c84ef77..26bd6c8f5ee 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Florian Henry * @@ -70,8 +70,6 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print "
\n"; -print "
\n"; - $head=agenda_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("Agenda")); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 52a77de8eae..5d4c787bf37 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -54,8 +54,7 @@ if ($actionsave) $db->begin(); $disableext=GETPOST('AGENDA_DISABLE_EXT','alpha'); - if ($disableext) $disableext=0; else $disableext=1; - $res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0,'',$conf->entity); $i=1; $errorsaved=0; $error=0; @@ -67,7 +66,7 @@ if ($actionsave) $src=trim(GETPOST('agenda_ext_src'.$i,'alpha')); $color=trim(GETPOST('agenda_ext_color'.$i,'alpha')); if ($color=='-1') $color=''; - + if (! empty($src) && ! preg_match('/^(http\s*|ftp\s*):/', $src)) { setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); @@ -75,26 +74,26 @@ if ($actionsave) $errorsaved++; break; } - + //print 'color='.$color; - $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $i++; } - + // Save nb of agenda if (! $error) { - $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity); if (! $res > 0) $error++; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; } - + if (! $error) { $db->commit(); @@ -124,34 +123,57 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print '
'; -print $langs->trans("AgendaExtSitesDesc")."
\n"; -print "
\n"; - $head=agenda_prepare_head(); dol_fiche_head($head, 'extsites', $langs->trans("Agenda")); +print $langs->trans("AgendaExtSitesDesc")."
\n"; +print "
\n"; + print '
'; -$selectedvalue=(GETPOST('AGENDA_DISABLE_AGENDA','alpha'))?GETPOST('AGENDA_DISABLE_EXT','alpha'):$conf->global->AGENDA_DISABLE_EXT; +$selectedvalue=$conf->global->AGENDA_DISABLE_EXT; if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; -print $langs->trans("ExtSitesEnableThisTool").' '.$form->selectyesno("AGENDA_DISABLE_EXT",$selectedvalue,1).'

'; -$var=false; +$var=true; print ""; print ""; -print '"; -print ""; +print '"; +print '"; +print ""; + +// Show external agenda +$var=!$var; +print ""; +print ""; +print '"; print ""; // Nb of agenda -print ""; -print ""; -print ""; -print ""; +$var=!$var; +print ""; +print ""; +print '"; +print ""; print "
'.$langs->trans("Parameter")."".$langs->trans("Value")."'.$langs->trans("Parameter")."'.$langs->trans("Value")."
".$langs->trans("ExtSitesEnableThisTool")."'; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('AGENDA_DISABLE_EXT',array('enabled'=>array(0=>'.hideifnotset')),null,1); +} +else +{ + if($conf->global->AGENDA_DISABLE_EXT == 0) + { + print ''.img_picto($langs->trans("Enabled"),'on').''; + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } +} +print "
".$langs->trans("ExtSitesNbOfAgenda").""; -print ''; -print "
".$langs->trans("ExtSitesNbOfAgenda")."'; +print ''; +print "
"; print "
"; @@ -162,7 +184,7 @@ print ""; print "".$langs->trans("Parameter").""; print "".$langs->trans("Name").""; print "".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)'; -print ''.$langs->trans("Color").''; +print ''.$langs->trans("Color").''; print ""; $i=1; @@ -173,19 +195,19 @@ while ($i <= $MAXAGENDA) $name='AGENDA_EXT_NAME'.$key; $src='AGENDA_EXT_SRC'.$key; $color='AGENDA_EXT_COLOR'.$key; - + $var=!$var; print ""; // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name - print ''; + print ''; // URL - print ''; + print ''; // Color (Possible colors are limited by Google) - print ''; - //print $formadmin->select_colors($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->select_color((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, ''); + print ''; + //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); + print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; print ""; $i++; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 3dfc317509a..64e03fe7f9c 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -75,13 +75,13 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print '
'; -print $langs->trans("AgendaSetupOtherDesc")."
\n"; -print "
\n"; $head=agenda_prepare_head(); dol_fiche_head($head, 'xcal', $langs->trans("Agenda")); +print $langs->trans("AgendaSetupOtherDesc")."
\n"; +print "
\n"; print ''; print ''; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index b8245f2aa34..2b3194b9cad 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -303,7 +303,7 @@ print ''.$langs->trans("LDAPFieldDescriptionExample").''; print ' '; print ''; -// Date naissance +// Birthday $var=!$var; print ''.$langs->trans("LDAPFieldBirthdate").''; print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index df663aaa427..cbe59807a26 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -71,8 +71,6 @@ $_SESSION["mode"]=$mode; $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('',$langs->trans("Setup"),$help_url); -print_fiche_titre($langs->trans("ModulesSetup"),'','setup'); - // Search modules dirs $modulesdir = array(); @@ -194,19 +192,22 @@ asort($orders); //var_dump($categ); //var_dump($modules); -// Start to show page -if (empty($mode)) $mode='common'; -if ($mode==='common') print $langs->trans("ModulesDesc")."
\n"; -if ($mode==='other') print $langs->trans("ModulesSpecialDesc")."
\n"; -if ($mode==='interfaces') print $langs->trans("ModulesInterfaceDesc")."
\n"; -if ($mode==='functional') print $langs->trans("ModulesJobDesc")."
\n"; -if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
\n"; -if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."
\n"; - $nbofactivatedmodules=count($conf->modules); -print $langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1)); +$moreinfo=$langs->trans("TotalNumberOfActivatedModules",($nbofactivatedmodules-1)); + +print load_fiche_titre($langs->trans("ModulesSetup"),$moreinfo,'setup'); + +// Start to show page +if (empty($mode)) $mode='common'; +if ($mode==='common') print $langs->trans("ModulesDesc")."
\n"; +if ($mode==='other') print $langs->trans("ModulesSpecialDesc")."
\n"; +if ($mode==='interfaces') print $langs->trans("ModulesInterfaceDesc")."
\n"; +if ($mode==='functional') print $langs->trans("ModulesJobDesc")."
\n"; +if ($mode==='marketplace') print $langs->trans("ModulesMarketPlaceDesc")."
\n"; +if ($mode==='expdev') print $langs->trans("ModuleFamilyExperimental")."
\n"; + if ($nbofactivatedmodules <= 1) print ' '.img_warning($langs->trans("YouMustEnableOneModule")); -print '
'."\n"; +//print '
'."\n"; $h = 0; diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index 7411e164c97..1f1d80eb043 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2005-2007 Regis Houssin * @@ -44,7 +44,7 @@ print '
'.img_picto_common('', 'dolibarr_box.png print $langs->trans("Version").' / '.$langs->trans("DolibarrLicense").':'; print ''; //print "
\n"; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 36cc5ae1d3b..a0cb8af9726 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -195,7 +195,7 @@ print $langs->trans("BackupDescY").'

';
+ for="checkbox_disable_fk"> trans("CommandsToDisableForeignKeysForImport"); ?> trans('CommandsToDisableForeignKeysForImportWarning')); ?>
diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 4b886f2d24f..b0f32a3e69d 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -61,8 +61,8 @@ $object->substitutionarray=array( '__OTHER3__' => 'Other3', '__OTHER4__' => 'Other4', '__OTHER5__' => 'Other5', - '__SIGNATURE__' => 'TagSignature', - //'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet + '__SIGNATURE__' => 'TagSignature' + //,'__PERSONALIZED__' => 'Personalized' // Hidden because not used yet ); if (! empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) { @@ -86,8 +86,8 @@ $object->substitutionarrayfortest=array( '__OTHER3__' => 'TESTOther3', '__OTHER4__' => 'TESTOther4', '__OTHER5__' => 'TESTOther5', - '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''), - //'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet + '__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:'') + //,'__PERSONALIZED__' => 'TESTPersonalized' // Not used yet ); if (!empty($conf->global->MAILING_EMAIL_UNSUBSCRIBE)) { @@ -676,7 +676,7 @@ if ($action == 'create') print ''; print ''; print ''; print '';*/ // Message @@ -1124,7 +1124,7 @@ else // Background color print ''; // Message diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 17947e6e3ed..6b0cd0dfb93 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3018,29 +3018,23 @@ else if ($id > 0 || ! empty($ref)) // Amount print ''; - print ''; - print ''; - print ''; - print ''; - + print ''; + print ''; print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { print ''; - print ''; - print ''; + print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF { print ''; - print ''; - print ''; + print ''; } - print ''; - print ''; + print ''; // Statut print ''; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index e2832299ad4..6d782c892d9 100755 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -80,10 +80,6 @@ else if ($type == "o") $titre.=' ('.$langs->trans("OthersNotLinkedToThirdParty").')'; $urlfiche=""; } -if ($view == 'phone') { $text=" (Vue Telephones)"; } -if ($view == 'mail') { $text=" (Vue EMail)"; } -if ($view == 'recent') { $text=" (Recents)"; } -if (! empty($text)) $titre.= " $text"; if (GETPOST('button_removefilter')) { @@ -260,17 +256,10 @@ if ($result) print_liste_field_titre($langs->trans("Firstname"),$_SERVER["PHP_SELF"],"p.firstname", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); - if ($view == 'phone') - { - print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("Mobile"),$_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); - } - else - { - print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); - } + print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("Mobile"),$_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); 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 ''; @@ -293,27 +282,18 @@ if ($result) print ''; print ''; } - if ($view == 'phone') - { - print ''; - print ''; - print ''; - } - else - { - print ''; - print ''; - } + print ''; + print ''; + print ''; + print ''; print ''; print ''; } - if ($view == 'phone') - { - // Phone - print ''; - // Phone mobile - print ''; - // Fax - print ''; - } - else - { - // Phone - print ''; - // EMail - print ''; - } + // Phone + print ''; + // Phone mobile + print ''; + // Fax + print ''; + // EMail + print ''; // Date print ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index e5c1f2e6a2f..dffb7f37982 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -465,6 +465,7 @@ class FormOther * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void + * @deprecated */ function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') { @@ -479,9 +480,10 @@ class FormOther * @param string $form_name Name of form * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string $morecss Add css style into input field * @return void */ - function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') + function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='', $morecss='') { global $langs; @@ -529,7 +531,7 @@ class FormOther } } ); }); '; - $out.= ''; + $out.= ''; } else // In most cases, this is not used. We used instead function with no specific list of colors { @@ -545,7 +547,7 @@ class FormOther }); '; - $out.= ''; //print ''; foreach ($arrayofcolors as $val) { diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index ba2df7195f8..071034b5fcc 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -643,16 +643,27 @@ function setConstant(url, code, input, entity) { // Enable another element if (type == "disabled") { $.each(data, function(key, value) { - $("#" + value).removeAttr("disabled"); - if ($("#" + value).hasClass("butActionRefused") == true) { - $("#" + value).removeClass("butActionRefused"); - $("#" + value).addClass("butAction"); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).removeAttr("disabled"); + if ($(newvalue).hasClass("butActionRefused") == true) { + $(newvalue).removeClass("butActionRefused"); + $(newvalue).addClass("butAction"); } }); + } else if (type == "enabled") { + $.each(data, function(key, value) { + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).attr("disabled", true); + if ($(newvalue).hasClass("butAction") == true) { + $(newvalue).removeClass("butAction"); + $(newvalue).addClass("butActionRefused"); + } + }); // Show another element } else if (type == "showhide" || type == "show") { $.each(data, function(key, value) { - $("#" + value).show(); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).show(); }); // Set another constant } else if (type == "set") { @@ -687,16 +698,27 @@ function delConstant(url, code, input, entity) { // Disable another element if (type == "disabled") { $.each(data, function(key, value) { - $("#" + value).attr("disabled", true); - if ($("#" + value).hasClass("butAction") == true) { - $("#" + value).removeClass("butAction"); - $("#" + value).addClass("butActionRefused"); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).attr("disabled", true); + if ($(newvalue).hasClass("butAction") == true) { + $(newvalue).removeClass("butAction"); + $(newvalue).addClass("butActionRefused"); } }); + } else if (type == "enabled") { + $.each(data, function(key, value) { + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).removeAttr("disabled"); + if ($(newvalue).hasClass("butActionRefused") == true) { + $(newvalue).removeClass("butActionRefused"); + $(newvalue).addClass("butAction"); + } + }); // Hide another element } else if (type == "showhide" || type == "hide") { $.each(data, function(key, value) { - $("#" + value).hide(); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).hide(); }); // Delete another constant } else if (type == "del") { diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 64b1339a944..f22ae595a77 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -353,12 +353,13 @@ function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0) /** * On/off button for constant * - * @param string $code Name of constant - * @param array $input Input element (enable/disable or show/hide another element, set/del another constant) - * @param int $entity Entity to set + * @param string $code Name of constant + * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) + * @param int $entity Entity to set + * @param int $revertonoff Revert on/off * @return void */ -function ajax_constantonoff($code, $input=array(), $entity=false) +function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) { global $conf, $langs; @@ -399,8 +400,8 @@ function ajax_constantonoff($code, $input=array(), $entity=false) '."\n"; $out.= ''; - $out.= ''.img_picto($langs->trans("Disabled"),'switch_off').''; - $out.= ''.img_picto($langs->trans("Enabled"),'switch_on').''; + $out.= ''.($revertonoff?img_picto($langs->trans("Enabled"),'switch_on'):img_picto($langs->trans("Disabled"),'switch_off')).''; + $out.= ''.($revertonoff?img_picto($langs->trans("Disabled"),'switch_off'):img_picto($langs->trans("Enabled"),'switch_on')).''; $out.="\n"; return $out; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3acf7983fe3..3dec3cecc7f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2380,7 +2380,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath $return.= ''; if (dol_strlen($mesg)) { - $return.= ''; + $return.= ''; } $return.= '
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing',0); + print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; @@ -1001,7 +1001,7 @@ else // Background color /*print '
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($object->bgcolor,'bgcolor','edit_mailing',0); + print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($object->bgcolor,'bgcolor','edit_mailing',0); + print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans('Currency'.$conf->currency).''.price($object->total_ht,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva,1,'',1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_localtax1,1,'',1,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_localtax2,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc,1,'',1,-1,-1,$conf->currency).'
'.$langs->trans('Status').' '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ' '; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -365,22 +345,14 @@ if ($result) print ''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_date($db->jdate($obj->tms),"day").''.$mesg.''.$mesg.'
'."\n"; @@ -2554,20 +2554,21 @@ function vatrate($rate,$addpercent=false,$info_bits=0,$usestarfornpr=0) /** - * Fonction qui formate un montant pour visualisation - * Fonction utilisee dans les pdf et les pages html + * Function to format a value into an amount for visual output + * Function used into PDF and HTML pages * - * @param float $amount Montant a formater - * @param string $form Type de formatage, html ou pas (par defaut) - * @param Translate $outlangs Objet langs pour formatage text - * @param int $trunc 1=Tronque affichage si trop de decimales,0=Force le non troncage - * @param int $rounding Minimum number of decimal. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) + * @param float $amount Amount to format + * @param string $form Type of format, HTML or not (not by default) + * @param Translate $outlangs Object langs for output + * @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate + * @param int $rounding Minimum number of decimal to show. If not defined we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL) * @param int $forcerounding Force the number of decimal + * @param string $currency_code To add currency symbol (''=add nothing, 'XXX'=add currency symbols for XXX currency) * @return string Chaine avec montant formate * * @see price2num Revert function of price */ -function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1) +function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='') { global $langs,$conf; @@ -2623,8 +2624,16 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou { $output=number_format($amount, $nbdecimal, $dec, $thousand); } - $output.=$end; - + // Add symbol of currency if requested + $cursymbolbefore=$cursymbolafter=''; + if ($currency_code) + { + $listofcurrenciesbefore=array('USD'); + if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); + else $cursymbolafter.=$outlangs->getCurrencySymbol($currency_code); + } + $output.=$cursymbolbefore.$end.$cursymbolafter; + return $output; } @@ -2776,7 +2785,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") * Get type and rate of localtaxes for a particular vat rate/country fo thirdparty * * @param real $vatrate VAT Rate - * @param int $local Number of localtax (1 / 2) + * @param int $local Number of localtax (1 or 2, or 0 to return 1+2) * @param int $thirdparty company object * @return array array(Type of local tax (1 to 7 / 0 if not found), rate or amount of localtax) * @deprecated TODO We should remove this function by storing rate and type into detail lines. @@ -2799,6 +2808,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty) $obj = $db->fetch_object($resql); if ($local == 1) return array($obj->localtax1_type, $obj->localtax1); elseif ($local == 2) return array($obj->localtax2_type, $obj->localtax2); + else return array($obj->localtax1_type, $obj->localtax1, $obj->localtax2_type, $obj->localtax2); } return 0; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ddd38a8484d..87ec1643ef2 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -291,10 +291,21 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($usecontact) { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1)); - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; + + if (!empty($targetcontact->address)) { + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; + }else { + $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; + } // Country - if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code))."\n"; - + if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { + $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code))."\n"; + } + else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) { + $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; + } + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { // Tel @@ -311,7 +322,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; // Country - if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; + if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index ceccee1602c..bb1fd411b1f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -375,23 +375,18 @@ class pdf_einstein extends ModelePDFCommandes $vatrate=(string) $object->lines[$i]->tva_tx; // TODO : store local taxes types into object lines and remove this - $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); - $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); + if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; + if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; //end TODO // retrieve global local tax - if ($localtax1_type == '7') - $localtax1_rate = $localtax1_array[1]; - if ($localtax2_type == '7') - $localtax2_rate = $localtax2_array[1]; + if ($localtax1_type == '7') $localtax1_rate = $localtaxtmp_array[1]; + if ($localtax2_type == '7') $localtax2_rate = $localtaxtmp_array[3]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index fa8a13353fd..a5ee3d3d045 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -377,23 +377,18 @@ class pdf_crabe extends ModelePDFFactures $vatrate=(string) $object->lines[$i]->tva_tx; // TODO : store local taxes types into object lines and remove this - $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); - $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); + if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; + if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; //end TODO - + // retrieve global local tax - if ($localtax1_type == '7') - $localtax1_rate = $localtax1_array[1]; - if ($localtax2_type == '7') - $localtax2_rate = $localtax2_array[1]; + if ($localtax1_type == '7') $localtax1_rate = $localtaxtmp_array[1]; + if ($localtax2_type == '7') $localtax2_rate = $localtaxtmp_array[3]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 3757e424ada..44304f870f9 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -172,9 +172,9 @@ class modAdherent extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='MembersAndSubscriptions'; $this->export_permission[$r]=array(array("adherent","export")); - $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); - $this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'a.country'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.naiss'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); - $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'a.country'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.naiss'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); + $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civilite'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); + $this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'a.country'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); + $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'a.country'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); // Add extra fields $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; $resql=$this->db->query($sql); @@ -207,7 +207,7 @@ class modAdherent extends DolibarrModules $this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon $this->import_tables_array[$r]=array('a'=>MAIN_DB_PREFIX.'adherent','extra'=>MAIN_DB_PREFIX.'adherent_extrafields'); $this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id - $this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.naiss'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription'); + $this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.nom'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription'); // Add extra fields $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; $resql=$this->db->query($sql); @@ -223,7 +223,7 @@ class modAdherent extends DolibarrModules // End add extra fields $this->import_fieldshidden_array[$r]=array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'adherent'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r]=array('a.civilite'=>'code@'.MAIN_DB_PREFIX.'c_civilite','a.fk_adherent_type'=>'rowid@'.MAIN_DB_PREFIX.'adherent_type','a.morphy'=>'(phy|mor)','a.statut'=>'^[0|1]','a.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','a.datefin'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.nom'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.naiss'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); + $this->import_examplevalues_array[$r]=array('a.civilite'=>"MR",'a.nom'=>'Smith','a.firstname'=>'John','a.login'=>'jsmith','a.pass'=>'passofjsmith','a.fk_adherent_type'=>'1','a.morphy'=>'"mor" or "phy"','a.societe'=>'JS company','a.address'=>'21 jump street','a.zip'=>'55000','a.town'=>'New York','a.country'=>'1','a.email'=>'jsmith@example.com','a.birth'=>'1972-10-10','a.statut'=>"0 or 1",'a.note'=>"This is a comment on member",'a.datec'=>dol_print_date($now,'%Y-%m-%d'),'a.datefin'=>dol_print_date(dol_time_plus_duree($now, 1, 'y'),'%Y-%m-%d')); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 134c95e9a1e..0424409ef22 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -371,24 +371,20 @@ class pdf_azur extends ModelePDFPropales if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100; $vatrate=(string) $object->lines[$i]->tva_tx; + // TODO : store local taxes types into object lines and remove this - $localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc); - $localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc); - if (empty($localtax1_type)) - $localtax1_type = $localtax1_array[0]; - if (empty($localtax2_type)) - $localtax2_type = $localtax2_array[0]; + $localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc); + if ((! isset($localtax1_type)) || $localtax1_type=='') $localtax1_type = $localtaxtmp_array[0]; + if ((! isset($localtax2_type)) || $localtax2_type=='') $localtax2_type = $localtaxtmp_array[2]; //end TODO // retrieve global local tax - if ($localtax1_type == '7') - $localtax1_rate = $localtax1_array[1]; - if ($localtax2_type == '7') - $localtax2_rate = $localtax2_array[1]; + if ($localtax1_type == '7') $localtax1_rate = $localtaxtmp_array[1]; + if ($localtax2_type == '7') $localtax2_rate = $localtaxtmp_array[3]; - if ($localtax1ligne != 0 || $localtax1_type == '7') + if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7')) $this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne; - if ($localtax2ligne != 0 || $localtax2_type == '7') + if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7')) $this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne; if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index f850c20d07f..e4debd24e80 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -227,18 +227,18 @@ class Export $sql.=$this->array_export_sql_end[$indice]; //construction du filtrage si le parametrage existe - if (is_array($array_filterValue)) + if (is_array($array_filterValue) && !empty($array_filterValue)) { $sqlWhere=''; // pour ne pas a gerer le nombre de condition foreach ($array_filterValue as $key => $value) { - $sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]); + if ($value != '') $sqlWhere.=" and ".$this->build_filterQuery($this->array_export_TypeFields[$indice][$key], $key, $array_filterValue[$key]); } $sql.=$sqlWhere; } $sql.=$this->array_export_sql_order[$indice]; - + return $sql; } diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index df178f1ccab..55e8e3af0ce 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -63,6 +63,7 @@ alter table llx_adherent CHANGE COLUMN prenom firstname varchar(50); alter table llx_adherent CHANGE COLUMN ville town text; alter table llx_adherent CHANGE COLUMN cp zip varchar(10); alter table llx_adherent CHANGE COLUMN pays country varchar(50); +alter table llx_adherent CHANGE COLUMN naiss birth date; alter table llx_adherent CHANGE COLUMN fk_departement state_id varchar(50); alter table llx_bank_account CHANGE COLUMN adresse_proprio owner_address text; alter table llx_bank_account CHANGE COLUMN fk_departement state_id varchar(50); diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 821859228a3..936f04d78a4 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -48,7 +48,7 @@ create table llx_adherent phone varchar(30), phone_perso varchar(30), phone_mobile varchar(30), - naiss date, -- date de naissance + birth date, -- birthday photo varchar(255), -- filename or url of photo statut smallint NOT NULL DEFAULT 0, public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4daf950fcde..3b13ef6e834 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -289,7 +289,7 @@ GenericMaskCodes4a=Example on the 99th %s of the third party TheCompany done GenericMaskCodes4b=Example on third party created on 2007-03-01:
GenericMaskCodes4c=Example on product created on 2007-03-01:
GenericMaskCodes5=ABC{yy}{mm}-{000000} will give ABC0701-000099
{0000+100}-ZZZ/{dd}/XXX will give 0199-ZZZ/31/XXX -GenericNumRefModelDesc=Return a customizable number according to a defined mask. +GenericNumRefModelDesc=Returns a customizable number according to a defined mask. ServerAvailableOnIPOrPort=Server is available at address %s on port %s ServerNotAvailableOnIPOrPort=Server is not available at address %s on port %s DoTestServerAvailability=Test server connectivity @@ -915,7 +915,7 @@ RunningUpdateProcessMayBeRequired=Running the upgrade process seems to be requir YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from command line after login to a shell with user %s or you must add -W option at end of command line to provide %s password. YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP DownloadMoreSkins=More skins to download -SimpleNumRefModelDesc=Return the reference number with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence without hole and with no reset +SimpleNumRefModelDesc=Returns the reference number with format %syymm-nnnn where yy is year, mm is month and nnnn is a sequence without hole and with no reset ShowProfIdInAddress=Show professionnal id with addresses on documents TranslationUncomplete=Partial translation SomeTranslationAreUncomplete=Some languages may be partially translated or may contains errors. If you detect some, you can fix .lang text files into directory htdocs/langs and submit them on the forum at http://www.dolibarr.org. @@ -1025,7 +1025,7 @@ WatermarkOnDraftInvoices=Watermark on draft invoices (any if empty) PropalSetup=Commercial proposals module setup CreateForm=Create forms NumberOfProductLines=Number of product lines -ProposalsNumberingModules=Commercial proposal numbering modules +ProposalsNumberingModules=Commercial proposal numbering models ProposalsPDFModules=Commercial proposal documents models ClassifiedInvoiced=Classified invoiced HideTreadedPropal=Hide the treated commercial proposals in the list @@ -1036,7 +1036,7 @@ FreeLegalTextOnProposal=Free text on commercial proposals WatermarkOnDraftProposal=Watermark on draft commercial proposals (any if empty) ##### Orders ##### OrdersSetup=Order management setup -OrdersNumberingModules=Orders numbering modules +OrdersNumberingModules=Orders numbering models OrdersModelModule=Order documents models HideTreadedOrders=Hide the treated or canceled orders in the list ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes it possible not to step by the provisional order @@ -1050,7 +1050,7 @@ Bookmark4uSetup=Bookmark4u module setup ##### Interventions ##### InterventionsSetup=Interventions module setup FreeLegalTextOnInterventions=Free text on intervention documents -FicheinterNumberingModules=Intervention numbering modules +FicheinterNumberingModules=Intervention numbering models TemplatePDFInterventions=Intervention card documents models WatermarkOnDraftInterventionCards=Watermark on intervention card documents (any if empty) ##### Contracts ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2f4782dd3bb..04a95bf5980 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -25,7 +25,7 @@ HTMLCharset= Charset des pages HTML générées DBStoringCharset= Charset base pour stockage données DBSortingCharset= Charset base pour tri données WarningModuleNotActive= Module %s non actif -WarningOnlyPermissionOfActivatedModules= Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer les autres modules sur la page Accueil->Configuration->Modules +WarningOnlyPermissionOfActivatedModules= Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer d'autres modules sur la page Accueil->Configuration->Modules DolibarrSetup= Installation ou mise à jour de Dolibarr DolibarrUser= Utilisateur Dolibarr InternalUser= Utilisateur interne @@ -1349,7 +1349,7 @@ AccountancyCodeBuy=Code compta achat AgendaSetup= Configuration du module actions et agenda PasswordTogetVCalExport= Clé pour autoriser lien export PastDelayVCalExport=Ne pas exporter les événements de plus de -AGENDA_USE_EVENT_TYPE=Utilisez les type des évenements (administrable dans Configuration->Dictionnary->llx_c_actioncomm) +AGENDA_USE_EVENT_TYPE=Utilisez les types des évenements (administrable dans Configuration -> Dictionnaires -> Liste des types d'évenements de l'agenda) ##### ClickToDial ##### ClickToDialDesc= Ce module permet d'ajouter un petit picto à côté des numéros de téléphones. Un clic sur ce picto provoque l'appel de l'URL définie dans ce paramétrage. Ceci permet de provoquer des appels à un serveur de téléphonie depuis Dolibarr qui peut alors composer le numéro sur un système SIP par exemple. ##### Point Of Sales (CashDesk) ##### diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index d6de1fecf92..d6368514821 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -243,7 +243,7 @@ if ($action == 'add') $adh->typeid = $_POST["type"]; $adh->note = $_POST["comment"]; $adh->morphy = $_POST["morphy"]; - $adh->naiss = $birthday; + $adh->birth = $birthday; foreach($_POST as $key => $value){ if (preg_match("/^options_/",$key)){ diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index a5423468a2e..d250b838386 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -95,7 +95,7 @@ if ($id > 0) print ''.$langs->trans("Zip").' '.$langs->trans("Town").''.$object->zip.' '.$object->town.' '; print ''.$langs->trans("Country").''.$object->country.' '; print ''.$langs->trans("EMail").''.$object->email.' '; - print ''.$langs->trans("Birthday").''.$object->naiss.' '; + print ''.$langs->trans("Birthday").''.$object->birth.' '; if (isset($object->photo) && $object->photo !='') { diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index de4044e3574..971ad3dc449 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -101,7 +101,7 @@ if (! $sortfield) { $sortfield="nom"; } llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers")); -$sql = "SELECT rowid, firstname, lastname, societe, zip, town, email, naiss, photo"; +$sql = "SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent"; $sql.= " WHERE entity = ".$entity; $sql.= " AND statut = 1"; @@ -127,7 +127,7 @@ if ($result) print ''.$langs->trans("Firstname").''; print ' '.$langs->trans("Lastname").''; print ' / '.$langs->trans("Company").''."\n"; - //print_liste_field_titre($langs->trans("DateToBirth"),"public_list.php","naiss",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? + //print_liste_field_titre($langs->trans("DateToBirth"),"public_list.php","birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? print_liste_field_titre($langs->trans("EMail"),"public_list.php","email",'',$param,$sortfield,$sortorder); print_liste_field_titre($langs->trans("Zip"),"public_list.php","zip","",$param,$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),"public_list.php","town","",$param,$sortfield,$sortorder); @@ -141,7 +141,7 @@ if ($result) $var=!$var; print ""; print ''.dolGetFirstLastname($obj->firstname, $obj->lastname).($objp->societe?' / '.$objp->societe:'').''."\n"; - //print "$objp->naiss\n"; // est-ce nécessaire ?? + //print "$objp->birth\n"; // est-ce nécessaire ?? print ''.$objp->email.''."\n"; print ''.$objp->zip.''."\n"; print ''.$objp->town.''."\n"; diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 12840f7fd04..7ff24220b84 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -574,7 +574,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) $contact->phone_pro = $thirdparty->phone; $contact->phone_mobile = $thirdpartywithuser['phone_mobile']; $contact->fax = $thirdparty->fax; - + //Retreive all extrafield for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); @@ -666,31 +666,31 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser) * @return mixed */ function setUserPassword($authentication,$shortuser) { - + global $db,$conf,$langs; - + dol_syslog("Function: setUserPassword login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext); - + if ($authentication['entity']) $conf->entity=$authentication['entity']; - + $objectresp=array(); $errorcode='';$errorlabel=''; $error=0; - + $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); - + if ($fuser->societe_id) $socid=$fuser->societe_id; - + if (! $error && ! $shortuser) { $error++; $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter shortuser must be provided."; } - + if (! $error) { $fuser->getrights(); - + if ($fuser->rights->user->user->password || $fuser->rights->user->self->password) { $userstat=new User($db); @@ -698,7 +698,7 @@ function setUserPassword($authentication,$shortuser) { if($res) { $res = $userstat->setPassword($userstat,$shortuser['password']); - if($res) + if($res) { $objectresp = array( 'result'=>array('result_code' => 'OK', 'result_label' => ''), @@ -716,7 +716,7 @@ function setUserPassword($authentication,$shortuser) { $error++; $errorcode='NOT_FOUND'; $errorlabel='User not found'; } - + } else { @@ -724,15 +724,15 @@ function setUserPassword($authentication,$shortuser) { $errorcode='PERMISSION_DENIED'; $errorlabel='User does not have permission for this request'; } } - - + + if ($error) { $objectresp = array( 'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel) ); } - + return $objectresp; } diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 6db9eb00c2a..2a0e8e7b580 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -127,7 +127,7 @@ if ($resql) $obj = $db->fetch_object($resql); // sendto en RFC2822 - $sendto = str_replace(',',' ',dolGetFirstLastname($obj->firstname, $obj->lastname) ." <".$obj->email.">"; + $sendto = str_replace(',',' ',dolGetFirstLastname($obj->firstname, $obj->lastname) ." <".$obj->email.">"); // Make subtsitutions on topic and body $other=explode(';',$obj->other); diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index e89f8186552..d29992a21db 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -207,7 +207,7 @@ if ($result >= 0) $member->morphy='phy'; $member->photo=''; $member->public=1; - $member->naiss=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]); + $member->birth=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE]); $member->statut=-1; if (isset($ldapuser[$conf->global->LDAP_FIELD_MEMBER_STATUS])) diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index a0ee0efac83..f7a932250b2 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -222,7 +222,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $localobject->phone_perso='New tel perso'; $localobject->phone_mobile='New tel mobile'; $localobject->email='newemail@newemail.com'; - $localobject->naiss=$timestamp; + $localobject->birth=$timestamp; $result=$localobject->update($user); print __METHOD__." id=".$localobject->id." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -256,7 +256,7 @@ class AdherentTest extends PHPUnit_Framework_TestCase $this->assertEquals($localobject->phone_perso, $newobject->phone_perso); $this->assertEquals($localobject->phone_mobile, $newobject->phone_mobile); $this->assertEquals($localobject->email, $newobject->email); - $this->assertEquals($localobject->naiss, $timestamp); + $this->assertEquals($localobject->birth, $timestamp); $this->assertEquals($localobject->morphy, $newobject->morphy); //We return newobject because of new values @@ -281,11 +281,11 @@ class AdherentTest extends PHPUnit_Framework_TestCase $db=$this->savdb; $template = '%DOL_MAIN_URL_ROOT%,%ID%,%CIVILITE%,%FIRSTNAME%,%LASTNAME%,%FULLNAME%,%COMPANY%,'. - '%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%NAISS%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'. + '%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%,%EMAIL%,%BIRTH%,%PHOTO%,%LOGIN%,%PASSWORD%,%PRENOM%,'. '%NOM%,%SOCIETE%,%ADDRESS%,%ZIP%,%TOWN%,%COUNTRY%'; $expected = DOL_MAIN_URL_ROOT.','.$localobject->id.',0,New firstname,New name,New firstname New name,'. - 'New company,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->naiss,'day').',,'. + 'New company,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->birth,'day').',,'. 'newlogin,dolibspec,New firstname,New name,New company,New address,New zip,New town,Belgium'; $result = $localobject->makeSubstitution($template);