From 3574146baa903c5ffe828412e0fad586a8819bdf Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 24 Oct 2013 14:36:02 +0200 Subject: [PATCH 01/27] commit --- test/soapui/Dolibarr-soapui-project.xml | 514 ++++++++++++------------ 1 file changed, 257 insertions(+), 257 deletions(-) diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index a5cb4d96a99..e880ef1f5ad 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -1,4 +1,4 @@ - + http://localhostdolibarr/dolibarrnew/webservices/server_other.php?wsdl @@ -757,211 +757,211 @@ all -]]>http://localhost/dolibarr/htdocs/webservices/server_productorservice.php?wsdl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WS to get product or service - - - - - WS to create a product or service - - - - - WS to update a product or service - - - - - WS to get list of all products or services id and ref - - - - - WS to get list of all products or services for a category - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +]]>http://localhost/dolibarr/htdocs/webservices/server_productorservice.php?wsdl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WS to get product or service + + + + + WS to create a product or service + + + + + WS to update a product or service + + + + + WS to get list of all products or services id and ref + + + + + WS to get list of all products or services for a category + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarr/htdocs/webservices/server_productorservice.phphttp://localhostdolibarr/dolibarrnew/webservices/server_productorservice.phphttp://localhost/dolibarr/htdocs/webservices/server_productorservice.php<xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php @@ -1127,57 +1127,57 @@ 5 -]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php - - - - - - dolibarrkey - aaa - admin - admin - - - - - 1 - - 111 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +]]><xml-fragment/>UTF-8http://localhost/dolibarr/htdocs/webservices/server_productorservice.php + + + + + + dolibarrkey + aaa + admin + admin + + + + + 1 + + 111 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]>http://localhostdolibarr/webservices/server_user.php?wsdl From 6a86c31067c87d1653ec11e94524771f5a58f235 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 7 Nov 2013 13:17:08 +0100 Subject: [PATCH 02/27] Update Skype Module --- htdocs/langs/fr_FR/admin.lang | 2 ++ htdocs/langs/fr_FR/companies.lang | 2 ++ htdocs/user/class/user.class.php | 12 ++++++- htdocs/user/fiche.php | 52 +++++++++++++++++++++++++++++-- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8d73250d652..13ebb3c79c2 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -487,6 +487,8 @@ Module2700Desc= Utilise le service en ligne Gravatar (www.gravatar.com) pour aff Module2800Desc=Client FTP Module2900Name= GeoIPMaxmind Module2900Desc= Capacités de conversion GeoIP Maxmind +Module3100Name= Skype +Module3100Desc= Ajouter un button Skype dans les fiches adhérents / tiers / contacts Module5000Name=Multi-société Module5000Desc=Permet de gérer plusieurs sociétés Module6000Name=Workflow diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index c6f7aa39ac8..cd7da345a57 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -66,6 +66,8 @@ Country=Pays CountryCode=Code pays CountryId=Identifiant pays Phone=Téléphone +Skype=Skype +Call=Appeler PhonePro=Tél pro. PhonePerso=Tél perso. PhoneMobile=Tél portable diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 65ea0dd73f1..b89c3904f74 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot * Copyright (C) 2013 Philippe Grand + * 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 @@ -50,6 +51,7 @@ class User extends CommonObject var $firstname; var $note; var $email; + var $skype; var $job; var $signature; var $office_phone; @@ -140,7 +142,7 @@ class User extends CommonObject $login=trim($login); // Get user - $sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.job, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; + $sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,"; $sql.= " u.admin, u.login, u.note,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp,"; $sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid,"; @@ -203,6 +205,7 @@ class User extends CommonObject $this->office_fax = $obj->office_fax; $this->user_mobile = $obj->user_mobile; $this->email = $obj->email; + $this->skype = $obj->skype; $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin; @@ -917,6 +920,7 @@ class User extends CommonObject $this->lastname = $contact->lastname; $this->firstname = $contact->firstname; $this->email = $contact->email; + $this->skype = $contact->skype; $this->office_phone = $contact->phone_pro; $this->office_fax = $contact->fax; $this->user_mobile = $contact->phone_mobile; @@ -1110,6 +1114,7 @@ class User extends CommonObject $this->office_fax = trim($this->office_fax); $this->user_mobile = trim($this->user_mobile); $this->email = trim($this->email); + $this->skype = trim($this->skype); $this->job = trim($this->job); $this->signature = trim($this->signature); $this->note = trim($this->note); @@ -1145,6 +1150,7 @@ class User extends CommonObject $sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; $sql.= ", email = '".$this->db->escape($this->email)."'"; + $sql.= ", skype = '".$this->db->escape($this->skype)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; @@ -1206,6 +1212,7 @@ class User extends CommonObject $adh->societe=(empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe); $adh->email=$this->email; + $adh->skype=$this->skype; $adh->phone=$this->office_phone; $adh->phone_mobile=$this->user_mobile; @@ -1914,6 +1921,7 @@ class User extends CommonObject if ($this->office_fax && ! empty($conf->global->LDAP_FIELD_FAX)) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax; if ($this->note && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; if ($this->email && ! empty($conf->global->LDAP_FIELD_MAIL)) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email; + if ($this->skype && ! empty($conf->global->LDAP_FIELD_SKYPE)) $info[$conf->global->LDAP_FIELD_SKYPE] = $this->skype; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { @@ -1966,6 +1974,7 @@ class User extends CommonObject $this->firstname='SPECIMEN'; $this->note='This is a note'; $this->email='email@specimen.com'; + $this->skype='tom.hanson'; $this->office_phone='0999999999'; $this->office_fax='0999999998'; $this->user_mobile='0999999997'; @@ -2113,6 +2122,7 @@ class User extends CommonObject $this->user_mobile=$ldapuser->{$conf->global->LDAP_FIELD_MOBILE}; $this->office_fax=$ldapuser->{$conf->global->LDAP_FIELD_FAX}; $this->email=$ldapuser->{$conf->global->LDAP_FIELD_MAIL}; + $this->skype=$ldapuser->{$conf->global->LDAP_FIELD_SKYPE}; $this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID}; $this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE}; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index caa0837f701..064cfcc9f24 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -8,6 +8,7 @@ * Copyright (C) 2011 Herve Prot * Copyright (C) 2012 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 @@ -184,6 +185,7 @@ if ($action == 'add' && $canadduser) $object->office_phone = GETPOST("office_phone"); $object->office_fax = GETPOST("office_fax"); $object->user_mobile = GETPOST("user_mobile"); + $object->skype = GETPOST("skype"); $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); @@ -321,10 +323,11 @@ if ($action == 'update' && ! $_POST["cancel"]) $object->office_phone=GETPOST("office_phone"); $object->office_fax = GETPOST("office_fax"); $object->user_mobile= GETPOST("user_mobile"); + $object->skype =GETPOST("skype"); $object->email = GETPOST("email"); $object->job = GETPOST("job"); $object->signature = GETPOST("signature"); - $object->accountancy_code = GETPOST("accountancy_code"); + $object->accountancy_code = GETPOST("accountancy_code"); $object->openid = GETPOST("openid"); $object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0; @@ -520,6 +523,7 @@ if ($action == 'adduserldap') $conf->global->LDAP_FIELD_PHONE, $conf->global->LDAP_FIELD_FAX, $conf->global->LDAP_FIELD_MOBILE, + $conf->global->LDAP_FIELD_SKYPE, $conf->global->LDAP_FIELD_MAIL, $conf->global->LDAP_FIELD_TITLE, $conf->global->LDAP_FIELD_DESCRIPTION, @@ -548,6 +552,7 @@ if ($action == 'adduserldap') $ldap_phone = $attribute[$conf->global->LDAP_FIELD_PHONE]; $ldap_fax = $attribute[$conf->global->LDAP_FIELD_FAX]; $ldap_mobile = $attribute[$conf->global->LDAP_FIELD_MOBILE]; + $ldap_skype = $attribute[$conf->global->LDAP_FIELD_SKYPE]; $ldap_mail = $attribute[$conf->global->LDAP_FIELD_MAIL]; $ldap_sid = $attribute[$conf->global->LDAP_FIELD_SID]; } @@ -605,9 +610,10 @@ if (($action == 'create') || ($action == 'adduserldap')) $conf->global->LDAP_FIELD_LOGIN_SAMBA, $conf->global->LDAP_FIELD_PASSWORD, $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, - $conf->global->LDAP_FIELD_PHONE, + $conf->global->LDAP_FIELD_PHONE, $conf->global->LDAP_FIELD_FAX, $conf->global->LDAP_FIELD_MOBILE, + $conf->global->LDAP_FIELD_SKYPE, $conf->global->LDAP_FIELD_MAIL, $conf->global->LDAP_FIELD_TITLE, $conf->global->LDAP_FIELD_DESCRIPTION, @@ -858,6 +864,23 @@ if (($action == 'create') || ($action == 'adduserldap')) print ''; } print ''; + + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + print ''; + if (! empty($ldap_skype)) + { + print ''; + print $ldap_skype; + } + else + { + print ''; + } + print ''; + } // EMail print 'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; @@ -1166,6 +1189,14 @@ else print ''.$langs->trans("Fax").''; print ''.dol_print_phone($object->office_fax,'',0,0,1).''; print ''."\n"; + + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + print ''.dol_print_skype($object->skype,0,0,1).''; + print "\n"; + } // EMail print ''.$langs->trans("EMail").''; @@ -1761,6 +1792,23 @@ else } print ''; + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + print ''; + if ($caneditfield && empty($object->ldap_sid)) + { + print ''; + } + else + { + print ''; + print $object->skype; + } + print ''; + } + // EMail print "".'global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; print ''; From be30cb8cbfe926bb846c9541e1c7d8a9623dede1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 15:57:24 +0100 Subject: [PATCH 03/27] Removed unused tables from installer Fixes installer bug --- .../install/mysql/tables/llx_soc_localtaxes | 26 ------------------- .../mysql/tables/llx_soc_localtaxes.key.sql | 22 ---------------- 2 files changed, 48 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_soc_localtaxes delete mode 100644 htdocs/install/mysql/tables/llx_soc_localtaxes.key.sql diff --git a/htdocs/install/mysql/tables/llx_soc_localtaxes b/htdocs/install/mysql/tables/llx_soc_localtaxes deleted file mode 100644 index 9293562d916..00000000000 --- a/htdocs/install/mysql/tables/llx_soc_localtaxes +++ /dev/null @@ -1,26 +0,0 @@ --- ============================================================================ --- Copyright (C) 2013 Juanjo Menent --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =========================================================================== - -create table llx_soc_localtaxes -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_soc integer, - fk_tva integer, - localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate - localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate - )ENGINE=innodb; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_soc_localtaxes.key.sql b/htdocs/install/mysql/tables/llx_soc_localtaxes.key.sql deleted file mode 100644 index e0a5cdc2c45..00000000000 --- a/htdocs/install/mysql/tables/llx_soc_localtaxes.key.sql +++ /dev/null @@ -1,22 +0,0 @@ --- ============================================================================ --- Copyright (C) 2013 Juanjo Menent --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 3 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- ============================================================================ - - -ALTER TABLE llx_soc_localtax ADD UNIQUE INDEX uk_soc_localtax_tax (fk_soc, fk_tax); - -ALTER TABLE llx_propal ADD INDEX idx_soc_localtax_fk_soc (fk_soc); From 1f6cccc3dc8834c0db1485f5a852701a127162e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 20:35:02 +0100 Subject: [PATCH 04/27] Removed return from void function The function is declared void and the return value was not used anywhere --- htdocs/ecm/class/ecmdirectory.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3c12fe066e9..35a03f487f9 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -642,8 +642,6 @@ class EcmDirectory // extends CommonObject $this->build_path_from_id_categ($val,$protection); } } - - return 1; } /** From 638764f86d3e545ff131f47e5c48a49e3222e494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 20:38:06 +0100 Subject: [PATCH 05/27] Moved unreachable statement to conditions --- htdocs/comm/action/class/cactioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index e9fe439e75c..c05887ec47f 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -78,14 +78,14 @@ class CActionComm $this->libelle = $obj->libelle; $this->active = $obj->active; + $this->db->free($resql); return 1; } else { + $this->db->free($resql); return 0; } - - $this->db->free($resql); } else { From 8907c9944db8e644eeb144f42fd95e86a179bf2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 20:51:30 +0100 Subject: [PATCH 06/27] Assigments in conditions is often considered bad practice So let's put a comment, just in case --- htdocs/comm/action/class/actioncomm.class.php | 2 ++ htdocs/comm/propal/class/propal.class.php | 2 ++ htdocs/ecm/class/ecmdirectory.class.php | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 0310f5e0cdd..33057e96eb8 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -611,6 +611,7 @@ class ActionComm extends CommonObject $resql=$this->db->query($sql); if ($resql) { + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; @@ -933,6 +934,7 @@ class ActionComm extends CommonObject if ($resql) { // Note: Output of sql request is encoded in $conf->file->character_set_client + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $qualified=true; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index b03d67f1701..ada87415b11 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2368,6 +2368,7 @@ class Propal extends CommonObject if ($mode == 'opened') $delay_warning=$conf->propal->cloture->warning_delay; if ($mode == 'signed') $delay_warning=$conf->propal->facturation->warning_delay; + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nbtodo++; @@ -2506,6 +2507,7 @@ class Propal extends CommonObject $resql=$this->db->query($sql); if ($resql) { + // This assignment in condition is not a bug. It allows walking the results. while ($obj=$this->db->fetch_object($resql)) { $this->nb["proposals"]=$obj->nb; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 35a03f487f9..b80cc84414e 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -490,7 +490,8 @@ class EcmDirectory // extends CommonObject $resql = $this->db->query($sql); if ($resql) { - while ($obj= $this->db->fetch_object($resql)) + // This assignment in condition is not a bug. It allows walking the results. + while ($obj=$this->db->fetch_object($resql)) { $this->motherof[$obj->id_son]=$obj->id_parent; } @@ -555,6 +556,7 @@ class EcmDirectory // extends CommonObject { $this->cats = array(); $i=0; + // This assignment in condition is not a bug. It allows walking the results. while ($obj = $this->db->fetch_object($resql)) { $this->cats[$obj->rowid]['id'] = $obj->rowid; From 9e0f8c5f571e317778f917798f2220f75c2123b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:02:21 +0100 Subject: [PATCH 07/27] Method is void, let's not print void --- htdocs/comm/action/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index f03d09cd5a5..464537416d6 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -518,7 +518,7 @@ if ($action == 'create') if (GETPOST("afaire") == 1) $percent=0; else if (GETPOST("afaire") == 2) $percent=100; } - print $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); + $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); print ''; // Location @@ -774,7 +774,7 @@ if ($id > 0) // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; - print $htmlactions->form_select_status_action('formaction',$percent,1); + $htmlactions->form_select_status_action('formaction',$percent,1); print ''; // Location From fa43476890f9e5ef72b6d0ba0bfce2c2ce37b5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:02:50 +0100 Subject: [PATCH 08/27] Fixed methods description These methods were declared void but actually returns values. Added proper documentation. --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a3ddb70e5f6..869a989e55d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2135,7 +2135,7 @@ abstract class CommonObject * Add/Update all extra fields values for the current object. * All data to describe values to insert are stored into $this->array_options=array('keyextrafield'=>'valueextrafieldtoadd') * - * @return void + * @return int -1=error, O=did nothing, 1=OK */ function insertExtraFields() { diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index cc295197119..ae9858dec92 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -509,7 +509,7 @@ class FormCompany * @param string $htmlname Name of HTML form * @param array $limitto Disable answers that are not id in this array list * @param int $forceid This is to force another object id than object->id - * @return void + * @return int The selected third party ID * TODO obsolete ? * cette fonction doit utiliser du javascript quoi qu'il en soit ! * autant utiliser le système combobox sans rechargement de page non ? From 74f83b235a046ecce7a2bdb1e9f1ca757c502c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:05:39 +0100 Subject: [PATCH 09/27] Typecasting The GETPOST method returns string, let's make the typecast explicit. --- htdocs/comm/action/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 464537416d6..59aa76132b3 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -167,7 +167,7 @@ if ($action == 'add_action') $actioncomm->datep = $datep; $actioncomm->datef = $datef; $actioncomm->percentage = $percentage; - $actioncomm->duree=((GETPOST('dureehour') * 60) + GETPOST('dureemin')) * 60; + $actioncomm->duree=((float)(GETPOST('dureehour') * 60) + (float)GETPOST('dureemin')) * 60; $usertodo=new User($db); if ($_POST["affectedto"] > 0) From d5ab0723bafddb10bb415c70f0f392d86eae96d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:12:11 +0100 Subject: [PATCH 10/27] Timestamp is not a type Timestamps are integers so let's document this correctly --- htdocs/comm/action/class/ical.class.php | 4 ++-- htdocs/comm/propal/class/propal.class.php | 14 +++++++------- htdocs/core/lib/date.lib.php | 8 ++++---- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 4dc47cdc395..0e279adc03c 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -270,7 +270,7 @@ class ICal * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * * @param string $ical_date String date - * @return timestamp + * @return int */ function ical_date_to_unix($ical_date) { @@ -395,4 +395,4 @@ class ICal return $this->cal; } } -?> \ No newline at end of file +?> diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index ada87415b11..7f2b3f5bb3c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -305,8 +305,8 @@ class Propal extends CommonObject * @param int $fk_fournprice Id supplier price * @param int $pa_ht Buying price without tax * @param string $label ??? - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param int $date_start Start date of the line + * @param int $date_end End date of the line * @param array $array_option extrafields array * @return int >0 if OK, <0 if KO * @@ -479,8 +479,8 @@ class Propal extends CommonObject * @param int $pa_ht Price (without tax) of product when it was bought * @param string $label ??? * @param int $type 0/1=Product/service - * @param timestamp $date_start Start date of the line - * @param timestamp $date_end End date of the line + * @param int $date_start Start date of the line + * @param int $date_end End date of the line * @param array $array_option extrafields array * @return int 0 if OK, <0 if KO */ @@ -1370,7 +1370,7 @@ class Propal extends CommonObject * Define proposal date * * @param User $user Object user that modify - * @param timestamp $date Date + * @param int $date Date * @return int <0 if KO, >0 if OK */ function set_date($user, $date) @@ -1407,7 +1407,7 @@ class Propal extends CommonObject * Define end validity date * * @param User $user Object user that modify - * @param timestamp $date_fin_validite End of validity date + * @param int $date_fin_validite End of validity date * @return int <0 if KO, >0 if OK */ function set_echeance($user, $date_fin_validite) @@ -1434,7 +1434,7 @@ class Propal extends CommonObject * Set delivery date * * @param User $user Object user that modify - * @param timestamp $date_livraison Delivery date + * @param int $date_livraison Delivery date * @return int <0 if ko, >0 if ok */ function set_date_livraison($user, $date_livraison) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 95eb057b547..78551dac105 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -166,10 +166,10 @@ function getParentCompanyTimeZoneInt($refgmtdate='now') /** * Add a delay to a date * - * @param timestamp $time Date timestamp (or string with format YYYY-MM-DD) + * @param int $time Date timestamp (or string with format YYYY-MM-DD) * @param int $duration_value Value of delay to add * @param int $duration_unit Unit of added delay (d, m, y, w) - * @return timestamp New timestamp + * @return int New timestamp */ function dol_time_plus_duree($time,$duration_value,$duration_unit) { @@ -317,7 +317,7 @@ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengt * DD/MM/YY HH:MM:SS or DD/MM/YYYY HH:MM:SS (this format should not be used anymore) * @param int $gm 1 =Input date is GM date, * 0 =Input date is local date using PHP server timezone - * @return date Date + * @return int Date as a timestamp * 19700101020000 -> 7200 with gm=1 * * @see dol_print_date, dol_mktime, dol_getdate @@ -812,4 +812,4 @@ function monthArray($outputlangs) return $montharray; } -?> \ No newline at end of file +?> diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b64f403b758..1021316b0df 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -461,7 +461,7 @@ function dol_filesize($pathoffile) * Return time of a file * * @param string $pathoffile Path of file - * @return timestamp Time of file + * @return int Time of file */ function dol_filemtime($pathoffile) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9e67318d693..202e1f0cb4a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -776,7 +776,7 @@ function dol_strftime($fmt, $ts=false, $is_gmt=false) * Output date in a string format according to outputlangs (or langs if not defined). * Return charset is always UTF-8, except if encodetoouput is defined. In this case charset is output charset * - * @param timestamp $time GM Timestamps date + * @param int $time GM Timestamps date * @param string $format Output date format * "%d %b %Y", * "%d/%m/%Y %H:%M", @@ -932,7 +932,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e * WARNING: This function always use PHP server timezone to return locale informations. * Usage must be avoid. * - * @param timestamp $timestamp Timestamp + * @param int $timestamp Timestamp * @param boolean $fast Fast mode * @return array Array of informations * If no fast mode: @@ -989,7 +989,7 @@ function dol_getdate($timestamp,$fast=false) * @param int $year Year * @param int $gm 1=Input informations are GMT values, otherwise local to server TZ * @param int $check 0=No check on parameters (Can use day 32, etc...) - * @return timestamp Date as a timestamp, '' if error + * @return int Date as a timestamp, '' if error * @see dol_print_date, dol_stringtotime, dol_getdate */ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) @@ -1048,7 +1048,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) * 'tzserver' => we add the PHP server timezone * 'tzref' => we add the company timezone * 'tzuser' => we add the user timezone - * @return timestamp $date Timestamp + * @return int $date Timestamp */ function dol_now($mode='gmt') { From 01ea84a917e0bda270197700063bf3101a8a9a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:12:48 +0100 Subject: [PATCH 11/27] Static members are not always strings Update method documentation to reflect the mixed type expected --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 202e1f0cb4a..19e6e6c8b81 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -45,7 +45,7 @@ if (! function_exists('json_encode')) * * @param string $class Class name * @param string $member Name of property - * @return string Return value of static property. + * @return mixed Return value of static property */ function getStaticMember($class, $member) { From c845124b925ed0826857b628d5b2c79eb9a3cf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:23:29 +0100 Subject: [PATCH 12/27] Object type is lowercase --- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 4 ++-- htdocs/core/class/interfaces.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/ecm.lib.php | 4 ++-- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/core/lib/propal.lib.php | 4 ++-- htdocs/core/modules/propale/modules_propale.php | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3ba7fee84c4..296ae741e1b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3942,7 +3942,7 @@ class Form * Return a HTML area with the reference of object and a navigation bar for a business object * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria. * - * @param Object $object Object to show + * @param object $object Object to show * @param string $paramid Name of parameter to use to name the id into the URL link * @param string $morehtml More html content to output just before the nav bar * @param int $shownav Show Condition (navigation is shown if value is 1) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index ae9858dec92..76b2810d59b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -503,7 +503,7 @@ class FormCompany /** * Return list of third parties * - * @param Object $object Object we try to find contacts + * @param object $object Object we try to find contacts * @param string $var_id Name of id field * @param string $selected Pre-selected third party * @param string $htmlname Name of HTML form @@ -616,7 +616,7 @@ class FormCompany /** * Return a select list with types of contacts * - * @param Object $object Object to use to find type of contact + * @param object $object Object to use to find type of contact * @param string $selected Default selected value * @param string $htmlname HTML select name * @param string $source Source ('internal' or 'external') diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index a40c7250103..78276c27885 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -48,7 +48,7 @@ class Interfaces * This function call all qualified triggers. * * @param string $action Trigger event code - * @param Object $object Objet concern + * @param object $object Objet concern * @param User $user Objet user * @param Lang $langs Objet lang * @param Conf $conf Objet conf diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 62f8b49d65e..26434af9c22 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -404,7 +404,7 @@ function agenda_prepare_head() /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param object $object Object related to tabs * @return array Array of tabs to shoc */ function actions_prepare_head($object) diff --git a/htdocs/core/lib/ecm.lib.php b/htdocs/core/lib/ecm.lib.php index ca92c6d77bc..6050c39da74 100644 --- a/htdocs/core/lib/ecm.lib.php +++ b/htdocs/core/lib/ecm.lib.php @@ -26,7 +26,7 @@ /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param object $object Object related to tabs * @return array Array of tabs to shoc */ function ecm_prepare_head($object) @@ -66,7 +66,7 @@ function ecm_file_prepare_head($object) /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param object $object Object related to tabs * @return array Array of tabs to shoc */ function ecm_prepare_head_fm($object) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1021316b0df..80318c20a40 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -830,7 +830,7 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0) /** * Delete all preview files linked to object instance * - * @param Object $object Object to clean + * @param object $object Object to clean * @return int 0 if error, 1 if OK */ function dol_delete_preview($object) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 6f55b8d130b..4727044ba45 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -178,7 +178,7 @@ function dol_print_file($langs,$filename,$searchalt=0) * Show informations on an object * TODO Move this into html.formother * - * @param Object $object Objet to show + * @param object $object Objet to show * @return void */ function dol_print_object_info($object) diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 435567bebae..d43885adf95 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -26,7 +26,7 @@ /** * Prepare array with list of tabs * - * @param Object $object Object related to tabs + * @param object $object Object related to tabs * @return array Array of tabs to shoc */ function propal_prepare_head($object) @@ -147,4 +147,4 @@ function propal_admin_prepare_head($object) } -?> \ No newline at end of file +?> diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index b5a25954df9..b6948a530be 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -147,7 +147,7 @@ abstract class ModeleNumRefPropales * Create a document onto disk according to template module. * * @param DoliDB $db Database handler - * @param Object $object Object proposal + * @param object $object Object proposal * @param string $modele Force model to use ('' to not force) * @param Translate $outputlangs Object langs to use for output * @param int $hidedetails Hide details of lines From e514b50d7e016408cd24182929a11f5839372293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:24:01 +0100 Subject: [PATCH 13/27] Typo fix --- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 7f2b3f5bb3c..62955d8c5d6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -296,7 +296,7 @@ class Propal extends CommonObject * @param int $fk_product Id du produit/service predefini * @param double $remise_percent Pourcentage de remise de la ligne * @param string $price_base_type HT or TTC - * @param dobule $pu_ttc Prix unitaire TTC + * @param double $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $type Type of line (product, service) * @param int $rang Position of line diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 80318c20a40..389a3e77059 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -448,7 +448,7 @@ function dol_count_nb_of_line($file) /** * Return size of a file * - * @param tring $pathoffile Path of file + * @param string $pathoffile Path of file * @return string File size */ function dol_filesize($pathoffile) From 9746702d783fa979113f90bb19a8cdc3b09613c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:24:52 +0100 Subject: [PATCH 14/27] FTP connections are resources Avoid declaring it as int --- htdocs/ftp/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 9c4f2cfffef..d7017e9ca00 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -71,7 +71,7 @@ $ftp_user=$conf->global->$s_ftp_user; $ftp_password=$conf->global->$s_ftp_password; $ftp_passive=$conf->global->$s_ftp_passive; -$conn_id=0; // FTP connection ID +$conn_id=null; // FTP connection ID From 8e1fd7a083376a21e578be69f308e0e207e48609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:36:25 +0100 Subject: [PATCH 15/27] PHP doesn't know reals, use float --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 19e6e6c8b81..a311c78b496 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2920,7 +2920,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") * Instead this function must be called when adding a line to get (array of localtax and type) and * provide it to the function calcul_price_total. * - * @param real $vatrate VAT Rate + * @param float $vatrate VAT Rate * @param int $local Number of localtax (1 or 2, or 0 to return 1 & 2) * @param int $thirdparty Company object * @return array array(localtax_type1(1-6 / 0 if not found), rate of localtax1, ...) From 9be462e43c52936943fb985ca53d8e96d3662dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 21:46:23 +0100 Subject: [PATCH 16/27] Text is not a type, let's use string --- htdocs/comm/propal/class/propal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 62955d8c5d6..0e390697a80 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1625,7 +1625,7 @@ class Propal extends CommonObject * * @param User $user Object user that close * @param int $statut Statut - * @param text $note Comment + * @param string $note Comment * @param int $notrigger 1=Does not execute triggers, 0= execuete triggers * @return int <0 if KO, >0 if OK */ @@ -1688,7 +1688,7 @@ class Propal extends CommonObject * * @param User $user Object user that close * @param int $statut Statut - * @param text $note Comment + * @param string $note Comment * @return int <0 if KO, >0 if OK */ function cloture($user, $statut, $note) From 9faa8325605fdced7b0a6bd3db212ae6eb627b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 22:11:43 +0100 Subject: [PATCH 17/27] Wrong var --- htdocs/core/js/lib_head.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index dfe656a745e..ae6182177d7 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -214,7 +214,7 @@ function getTop(theitem){ offsetTrail = offsetTrail.offsetParent; } if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") - offsetLeft += document.body.TopMargin; + offsetTop += document.body.TopMargin; return offsetTop; } From b6eecb0394cdcff2709f2dd4d41094d0849f818f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Nov 2013 22:14:43 +0100 Subject: [PATCH 18/27] Developer documentation fix --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 907b78eaac1..3b61a3150b5 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1512,7 +1512,7 @@ function pdf_getTotalQty($object,$type,$outputlangs) * * @param object $object Object * @param Translate $outputlangs Object lang for output - * @return void + * @return array Linked objects */ function pdf_getLinkedObjects($object,$outputlangs) { From 6d415001364d149255f2c6524211dd2830ef3c31 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 8 Nov 2013 10:08:01 +0100 Subject: [PATCH 19/27] Fix : SQL error on margin page --- htdocs/margin/productMargins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 50d30a217f0..f16cb126e87 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -158,7 +158,7 @@ print ''; $sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref,"; $sql.= " d.fk_product,"; $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; -$sql.= " f.datef, f.paye, f.fk_statut as statut"; +$sql.= " f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; $sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; $sql.= " sum(".$db->ifsql('d.total_ht <=0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; From 150118245f1e9d387fa283462c4ca48f8773aea8 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 8 Nov 2013 13:58:48 +0100 Subject: [PATCH 20/27] Update societe.class.php wrong name of outstandingbill function --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a7d4ce2e850..e79242d35a9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2784,7 +2784,7 @@ class Societe extends CommonObject * @param User $user User making change * @return int <0 if KO, >0 if OK */ - function set_outstanding($user) + function set_OutstandingBill ($user) { if ($this->id) { From 1c6edf2d033e17bb407b75c8af3b8f9c2b10386b Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 8 Nov 2013 14:07:11 +0100 Subject: [PATCH 21/27] Fix : error in replenish SQL --- htdocs/product/stock/replenish.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a5754cf10b4..788bd8fee09 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -215,7 +215,7 @@ $sql.= ' GROUP BY p.rowid, p.ref, p.label, p.price'; $sql.= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql.= ', p.duration, p.tobuy, p.seuil_stock_alerte'; $sql.= ', p.desiredstock, s.fk_product'; -$sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "s.reel", "0").')'; +$sql.= ' HAVING p.desiredstock > SUM('.$db->ifsql("s.reel IS NULL", "0", "s.reel").')'; $sql.= ' AND p.desiredstock > 0'; if ($salert == 'on') // Option to see when stock is lower than alert { From 1fc2e495ba729c18578eadf338fe002f7a281c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 8 Nov 2013 14:42:28 +0100 Subject: [PATCH 22/27] Moved unreachable statement --- htdocs/core/lib/files.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 389a3e77059..17d96bd3356 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -398,16 +398,17 @@ function dol_dir_is_emtpy($folder) if (is_dir($newfolder)) { $handle = opendir($newfolder); + $folder_content = ''; while ((gettype($name = readdir($handle)) != "boolean")) { $name_array[] = $name; } foreach($name_array as $temp) $folder_content .= $temp; + closedir($handle); + if ($folder_content == "...") return true; else return false; - - closedir($handle); } else return true; // Dir does not exists From 2b29f45a437291425b5caf3cf1641dddbb1695cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 8 Nov 2013 14:42:42 +0100 Subject: [PATCH 23/27] Added class members that where declared dynamically --- htdocs/ecm/class/ecmdirectory.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index b80cc84414e..4abeea326e4 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -39,12 +39,20 @@ class EcmDirectory // extends CommonObject var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' var $date_c; var $date_m; + public $fk_user_m; + public $fk_user_c; + public $ref; var $cats=array(); var $motherof=array(); var $forbiddenchars = array('<','>',':','/','\\','?','*','|','"'); + public $full_arbo_loaded; + + public $error; + public $errors; + /** * Constructor From 594781ec62b1ca1baa0d6d28a3688ec093066794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 8 Nov 2013 15:31:22 +0100 Subject: [PATCH 24/27] Codestyle --- htdocs/comm/action/fiche.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 59aa76132b3..166847ed0f2 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -167,7 +167,8 @@ if ($action == 'add_action') $actioncomm->datep = $datep; $actioncomm->datef = $datef; $actioncomm->percentage = $percentage; - $actioncomm->duree=((float)(GETPOST('dureehour') * 60) + (float)GETPOST('dureemin')) * 60; + $actioncomm->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * +60; $usertodo=new User($db); if ($_POST["affectedto"] > 0) From 2b74f03eb628ffe37b006873c6bc1100e6cc5094 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 8 Nov 2013 16:24:03 +0100 Subject: [PATCH 25/27] Fix : column name changed --- htdocs/public/members/public_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 968b1a30065..d186467ee04 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -92,7 +92,7 @@ $filter=GETPOST('filter'); $statut=GETPOST('statut'); if (! $sortorder) { $sortorder="ASC"; } -if (! $sortfield) { $sortfield="nom"; } +if (! $sortfield) { $sortfield="lastname"; } /* From bb69fcf0d78511925b2f5c9d7c7e365c79e7f1a9 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 9 Nov 2013 07:00:59 +0100 Subject: [PATCH 26/27] Fix for language --- htdocs/compta/bank/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index b532266ce31..319ba7ab9d9 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -585,7 +585,7 @@ if ($id > 0 || ! empty($ref)) $banklinestatic->fetch($links[$key]['url_id']); $bankstatic->id=$banklinestatic->fk_account; $bankstatic->label=$banklinestatic->bank_account_label; - print ' ('.$langs->trans("from").' '; + print ' ('.$langs->trans("TransferFrom").' '; print $bankstatic->getNomUrl(1,'transactions'); print ' '.$langs->trans("toward").' '; $bankstatic->id=$objp->bankid; @@ -597,7 +597,7 @@ if ($id > 0 || ! empty($ref)) { $bankstatic->id=$objp->bankid; $bankstatic->label=$objp->bankref; - print ' ('.$langs->trans("from").' '; + print ' ('.$langs->trans("TransferFrom").' '; print $bankstatic->getNomUrl(1,''); print ' '.$langs->trans("toward").' '; $banklinestatic->fetch($links[$key]['url_id']); From 86a2da31b408fb24c76bf2d5548ab475a4caf11f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 10 Nov 2013 06:52:20 +0100 Subject: [PATCH 27/27] Fix for document cerfa into module Don --- htdocs/core/modules/dons/html_cerfafr.html | 2 +- htdocs/core/modules/dons/html_cerfafr.modules.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/dons/html_cerfafr.html b/htdocs/core/modules/dons/html_cerfafr.html index ebdd30c9376..cd4c06e763c 100644 --- a/htdocs/core/modules/dons/html_cerfafr.html +++ b/htdocs/core/modules/dons/html_cerfafr.html @@ -98,7 +98,7 @@ __Name__ :
- __DONATOR_NAME__
+ __DONATOR_FIRSTNAME__ __DONATOR_LASTNAME__
__Address__ :
__DONATOR_ADDRESS__
__Zip__ : __DONATOR_ZIP__
diff --git a/htdocs/core/modules/dons/html_cerfafr.modules.php b/htdocs/core/modules/dons/html_cerfafr.modules.php index 05c3dd96f24..a3811f51d6d 100644 --- a/htdocs/core/modules/dons/html_cerfafr.modules.php +++ b/htdocs/core/modules/dons/html_cerfafr.modules.php @@ -143,7 +143,8 @@ class html_cerfafr extends ModeleDon $form = str_replace('__MAIN_INFO_SOCIETE_ADDRESS__',$mysoc->address,$form); $form = str_replace('__MAIN_INFO_SOCIETE_ZIP__',$mysoc->zip,$form); $form = str_replace('__MAIN_INFO_SOCIETE_TOWN__',$mysoc->town,$form); - $form = str_replace('__DONATOR_NAME__',$don->nom,$form); + $form = str_replace('__DONATOR_FIRSTNAME__',$don->firstname,$form); + $form = str_replace('__DONATOR_LASTNAME__',$don->lastname,$form); $form = str_replace('__DONATOR_ADDRESS__',$don->address,$form); $form = str_replace('__DONATOR_ZIP__',$don->zip,$form); $form = str_replace('__DONATOR_TOWN__',$don->town,$form);