From 5223934ff03c05588f4a6832d110621221ddd346 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 14 Jul 2015 12:17:50 +0200 Subject: [PATCH 1/5] Fix #3188 SQL error if qty or discount is not a number on proposal add line --- 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 507a9dce633..60cbaa6ae0d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2910,14 +2910,14 @@ class PropaleLigne extends CommonObject $sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").","; $sql.= " '".$this->product_type."',"; $sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").","; - $sql.= " ".price2num($this->qty).","; + $sql.= " '".price2num($this->qty)."',"; $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; $sql.= " '".$this->localtax1_type."',"; $sql.= " '".$this->localtax2_type."',"; $sql.= " ".($this->subprice?price2num($this->subprice):"null").","; - $sql.= " ".price2num($this->remise_percent).","; + $sql.= " '".price2num($this->remise_percent)."',"; $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; From 8505e914695a0723da9fe719f1dfc3e1f4b4495b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 19 Jul 2015 13:46:25 +0200 Subject: [PATCH 2/5] Fix: [ bug 1791 ] Margin menu not available if any Finance module is not enabled --- ChangeLog | 1 + htdocs/core/menus/standard/eldy.lib.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67920bbfee3..828ab2eb738 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ Fix: [ bug #2837 ] Product list table column header does not match column body Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names +Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 83fcfca04bc..860acd993a0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -134,9 +134,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } // Financial - $tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled)), - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire)), - 'module'=>'comptabilite|accounting|facture|deplacement|don|tax'); + $tmpentry = array( + 'enabled' => (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->facture->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->don->enabled) || !empty($conf->tax->enabled) || !empty($conf->margin->enabled)), + 'perms' => (!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->plancompte->lire) || !empty($user->rights->facture->lire) || !empty($user->rights->deplacement->lire) || !empty($user->rights->don->lire) || !empty($user->rights->tax->charges->lire) || !empty($user->rights->margins->liretous)), + 'module' => 'comptabilite|accounting|facture|deplacement|don|tax' + ); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { From 428bd14b55153547aa44a1b8022d26f702eb6f00 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 21 Jul 2015 10:49:47 +0200 Subject: [PATCH 3/5] Merge branch '3.5' of github.com:Dolibarr/dolibarr into 3.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Veuillez entrer un message de validation pour expliquer en quoi cette fusion est # nécessaire, surtout si cela fusionne une branche amont mise à jour dans une branche de sujet. # # Les lignes commençant par '#' seront ignorées, et un message vide # abandonne la validation. --- ChangeLog | 5 + htdocs/compta/facture/stats/index.php | 9 +- .../class/rejetprelevement.class.php | 31 +- htdocs/contact/exportimport.php | 123 ++++--- htdocs/contact/info.php | 23 +- htdocs/contact/ldap.php | 284 +++++++-------- htdocs/contact/perso.php | 340 +++++++++--------- htdocs/contact/vcard.php | 130 +++---- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 8 +- htdocs/societe/info.php | 31 +- htdocs/societe/soc.php | 2 + 12 files changed, 512 insertions(+), 476 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab5fa93f635..6165077d1ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,11 @@ Fix: [ bug #2861 ] Undefined variable $res when migrating Fix: [ bug #2837 ] Product list table column header does not match column body Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page +Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names +Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid +Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter +Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result +Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 51747fe04d2..08c3750d0e4 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -217,6 +217,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type); dol_fiche_head($head,'byyear',$langs->trans("Statistics")); +$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1); +//Array passed as an argument to Form::selectarray to build a proper select input +$companies = array(); + +foreach ($tmp_companies as $value) { + $companies[$value['value']] = $value['label']; +} print '
'; @@ -232,7 +239,7 @@ print '
'; print ''.$langs->trans("ThirdParty").''; if ($mode == 'customer') $filter='s.client in (1,2,3)'; if ($mode == 'supplier') $filter='s.fournisseur = 1'; - print $form->select_company($socid,'socid',$filter,1); + print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 100%"'); print ''; // User print ''.$langs->trans("CreatedBy").''; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 77bafae3603..aae942468dd 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -87,7 +87,7 @@ class RejetPrelevement dol_syslog("RejetPrelevement::Create id $id"); $bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT; - $facs = $this->getListInvoices(); + $facs = $this->getListInvoices(1); $this->db->begin(); @@ -132,7 +132,7 @@ class RejetPrelevement for ($i = 0; $i < $num; $i++) { $fac = new Facture($this->db); - $fac->fetch($facs[$i]); + $fac->fetch($facs[$i][0]); // Make a negative payment $pai = new Paiement($this->db); @@ -144,7 +144,7 @@ class RejetPrelevement * PHP installs sends only the part integer negative */ - $pai->amounts[$facs[$i]] = price2num($fac->total_ttc * -1); + $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1); $pai->datepaye = $date_rejet; $pai->paiementid = 3; // type of payment: withdrawal $pai->num_paiement = $fac->ref; @@ -152,7 +152,7 @@ class RejetPrelevement if ($pai->create($this->user) < 0) // we call with no_commit { $error++; - dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i]); + dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); } else { @@ -269,22 +269,24 @@ class RejetPrelevement } /** - * Retrieve the list of invoices + * Retrieve the list of invoices + * @param int $amounts If you want to get the amount of the order for each invoice * - * @return void + * @return Array List of invoices related to the withdrawal line + * @TODO A withdrawal line is today linked to one and only one invoice. So the function should return only one object ? */ - private function getListInvoices() + private function getListInvoices($amounts=0) { global $conf; $arr = array(); //Returns all invoices of a withdrawal - $sql = "SELECT f.rowid as facid"; + $sql = "SELECT f.rowid as facid, pl.amount"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql.= ", ".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)"; $sql.= " WHERE pf.fk_prelevement_lignes = ".$this->id; - $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.entity = ".$conf->entity; $resql=$this->db->query($sql); @@ -298,7 +300,14 @@ class RejetPrelevement while ($i < $num) { $row = $this->db->fetch_row($resql); - $arr[$i] = $row[0]; + if (!$amounts) $arr[$i] = $row[0]; + else + { + $arr[$i] = array( + $row[0], + $row[1] + ); + } $i++; } } diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php index 5149eed9efb..c76655f5099 100644 --- a/htdocs/contact/exportimport.php +++ b/htdocs/contact/exportimport.php @@ -33,81 +33,80 @@ $id = GETPOST('id', 'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); +$contact = new Contact($db); + /* * View */ +$form = new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -$form = new Form($db); - -$contact = new Contact($db); -$contact->fetch($id, $user); - - -$head = contact_prepare_head($contact); - -dol_fiche_head($head, 'exportimport', $title, 0, 'contact'); - - -/* - * Fiche en mode visu - */ -print ''; - -$linkback = ''.$langs->trans("BackToList").''; - -// Ref -print ''; - -// Name -print ''; -print ''; - -// Company -if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) +if ($id > 0) { - if ($contact->socid > 0) - { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + $contact->fetch($id, $user); - print ''; - } - else - { - print ''; - } + $head = contact_prepare_head($contact); + + dol_fiche_head($head, 'exportimport', $title, 0, 'contact'); + + + /* + * Fiche en mode visu + */ + print '
'.$langs->trans("Ref").''; -print $form->showrefnav($contact, 'id', $linkback); -print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$contact->lastname.''.$langs->trans("Firstname").''.$contact->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print '
'; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Name + print ''; + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + { + if ($contact->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); + + print ''; + } + else + { + print ''; + } + } + + // Civility + print ''; + + print '
'.$langs->trans("Ref").''; + print $form->showrefnav($contact, 'id', $linkback); + print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$contact->lastname.''.$langs->trans("Firstname").''.$contact->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print '
'.$langs->trans("UserTitle").''; + print $contact->getCivilityLabel(); + print '
'; + + print '
'; + + print '
'; + + print $langs->trans("ExportCardToFormat").': '; + print ''; + print img_picto($langs->trans("VCard"),'vcard.png').' '; + print $langs->trans("VCard"); + print ''; } -// Civility -print ''.$langs->trans("UserTitle").''; -print $contact->getCivilityLabel(); -print ''; - -print ''; - -print '
'; - -print '
'; - -print $langs->trans("ExportCardToFormat").': '; -print ''; -print img_picto($langs->trans("VCard"),'vcard.png').' '; -print $langs->trans("VCard"); -print ''; - - - - $db->close(); llxFooter(); -?> diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index 3ac6747bb6b..5d4904faa87 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -35,6 +35,8 @@ $contactid = GETPOST("id",'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); +$contact = new Contact($db); + /* @@ -43,25 +45,26 @@ $result = restrictedArea($user, 'contact', $contactid, 'socpeople&societe'); llxHeader('',$langs->trans("ContactsAddresses"),'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); +if ($contactid > 0) +{ + $result = $contact->fetch($contactid, $user); -$contact = new Contact($db); -$contact->fetch($contactid, $user); -$contact->info($contactid); + $contact->info($contactid); -$head = contact_prepare_head($contact); + $head = contact_prepare_head($contact); -dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact'); + dol_fiche_head($head, 'info', $langs->trans("ContactsAddresses"), 0, 'contact'); -print '
'; -print '
'; + print '
'; + print '
'; -dol_print_object_info($contact); + dol_print_object_info($contact); -print "
"; + print "
"; +} llxFooter(); $db->close(); -?> diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index f284ee1834d..79e6246fc60 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -40,37 +40,40 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $contact = new Contact($db); -$contact->fetch($id, $user); - -/* - * Actions - */ - -if ($action == 'dolibarr2ldap') +if ($id > 0) { - $message=""; + $contact->fetch($id, $user); - $db->begin(); + /* + * Actions + */ - $ldap=new Ldap(); - $result=$ldap->connect_bind(); - - $info=$contact->_load_ldap_info(); - $dn=$contact->_load_ldap_dn($info); - $olddn=$dn; // We can say that old dn = dn as we force synchro - - $result=$ldap->update($dn,$info,$user,$olddn); - - if ($result >= 0) + if ($action == 'dolibarr2ldap') { - $message.='
'.$langs->trans("ContactSynchronized").'
'; - $db->commit(); - } - else - { - $message.='
'.$ldap->error.'
'; - $db->rollback(); + $message=""; + + $db->begin(); + + $ldap=new Ldap(); + $result=$ldap->connect_bind(); + + $info=$contact->_load_ldap_info(); + $dn=$contact->_load_ldap_dn($info); + $olddn=$dn; // We can say that old dn = dn as we force synchro + + $result=$ldap->update($dn,$info,$user,$olddn); + + if ($result >= 0) + { + $message.='
'.$langs->trans("ContactSynchronized").'
'; + $db->commit(); + } + else + { + $message.='
'.$ldap->error.'
'; + $db->rollback(); + } } } @@ -79,138 +82,139 @@ if ($action == 'dolibarr2ldap') * View */ +$form = new Form($db); + $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -$form = new Form($db); - -$head = contact_prepare_head($contact); - -dol_fiche_head($head, 'ldap', $title, 0, 'contact'); - - -print ''; - -// Ref -print ''; - -// Name -print ''; -print ''; - -// Company -if ($contact->socid > 0) +if ($id > 0) { - $objsoc = new Societe($db); - $objsoc->fetch($contact->socid); + $head = contact_prepare_head($contact); - print ''; -} -else -{ - print '
'.$langs->trans("Ref").''; -print $form->showrefnav($contact,'id'); -print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$contact->lastname.''.$langs->trans("Firstname").''.$contact->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); + dol_fiche_head($head, 'ldap', $title, 0, 'contact'); + + + print ''; + + // Ref + print ''; -} -// Civility -print ''; + // Name + print ''; + print ''; -// LDAP DN -print '\n"; - -// LDAP Cle -print '\n"; - -// LDAP Server -print '\n"; -print '\n"; -print '\n"; - -print '
'.$langs->trans("Ref").''; + print $form->showrefnav($contact,'id'); print '
'.$langs->trans("UserTitle").''; -print $contact->getCivilityLabel(); -print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$contact->lastname.''.$langs->trans("Firstname").''.$contact->firstname.'
LDAP '.$langs->trans("LDAPContactDn").''.$conf->global->LDAP_CONTACT_DN."
LDAP '.$langs->trans("LDAPNamingAttribute").''.$conf->global->LDAP_KEY_CONTACTS."
LDAP '.$langs->trans("LDAPPrimaryServer").''.$conf->global->LDAP_SERVER_HOST."
LDAP '.$langs->trans("LDAPSecondaryServer").''.$conf->global->LDAP_SERVER_HOST_SLAVE."
LDAP '.$langs->trans("LDAPServerPort").''.$conf->global->LDAP_SERVER_PORT."
'; - -print ''; - - -dol_htmloutput_mesg($message); - - -/* - * Barre d'actions - */ - -print '
'; - -if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') -{ - print ''.$langs->trans("ForceSynchronize").''; -} - -print "
\n"; - -if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "
\n"; - - - -// Affichage attributs LDAP -print_titre($langs->trans("LDAPInformationsForThisContact")); - -print ''; - -print ''; -print ''; -print ''; -print ''; - -// Lecture LDAP -$ldap=new Ldap(); -$result=$ldap->connect_bind(); -if ($result > 0) -{ - $info=$contact->_load_ldap_info(); - $dn=$contact->_load_ldap_dn($info,1); - $search = "(".$contact->_load_ldap_dn($info,2).")"; - $records=$ldap->getAttribute($dn,$search); - - //var_dump($records); - - // Affichage arbre - if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0)) + // Company + if ($contact->socid > 0) { - if (! is_array($records)) - { - print ''; - } - else - { - $result=show_ldap_content($records,0,$records['count'],true); - } + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); + + print ''; } else { - print ''; + print ''; } - $ldap->unbind(); - $ldap->close(); + // Civility + print ''; + + // LDAP DN + print '\n"; + + // LDAP Cle + print '\n"; + + // LDAP Server + print '\n"; + print '\n"; + print '\n"; + + print '
'.$langs->trans("LDAPAttributes").''.$langs->trans("Value").'
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')
'.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print '
'.$langs->trans("UserTitle").''; + print $contact->getCivilityLabel(); + print '
LDAP '.$langs->trans("LDAPContactDn").''.$conf->global->LDAP_CONTACT_DN."
LDAP '.$langs->trans("LDAPNamingAttribute").''.$conf->global->LDAP_KEY_CONTACTS."
LDAP '.$langs->trans("LDAPPrimaryServer").''.$conf->global->LDAP_SERVER_HOST."
LDAP '.$langs->trans("LDAPSecondaryServer").''.$conf->global->LDAP_SERVER_HOST_SLAVE."
LDAP '.$langs->trans("LDAPServerPort").''.$conf->global->LDAP_SERVER_PORT."
'; + + print ''; + + + dol_htmloutput_mesg($message); + + + /* + * Barre d'actions + */ + + print '
'; + + if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') + { + print ''.$langs->trans("ForceSynchronize").''; + } + + print "
\n"; + + if (! empty($conf->global->LDAP_CONTACT_ACTIVE) && $conf->global->LDAP_CONTACT_ACTIVE != 'ldap2dolibarr') print "
\n"; + + + + // Affichage attributs LDAP + print_titre($langs->trans("LDAPInformationsForThisContact")); + + print ''; + + print ''; + print ''; + print ''; + print ''; + + // Lecture LDAP + $ldap=new Ldap(); + $result=$ldap->connect_bind(); + if ($result > 0) + { + $info=$contact->_load_ldap_info(); + $dn=$contact->_load_ldap_dn($info,1); + $search = "(".$contact->_load_ldap_dn($info,2).")"; + $records=$ldap->getAttribute($dn,$search); + + //var_dump($records); + + // Affichage arbre + if (count($records) && $records != false && (! isset($records['count']) || $records['count'] > 0)) + { + if (! is_array($records)) + { + print ''; + } + else + { + $result=show_ldap_content($records,0,$records['count'],true); + } + } + else + { + print ''; + } + + $ldap->unbind(); + $ldap->close(); + } + else + { + dol_print_error('',$ldap->error); + } + + + print '
'.$langs->trans("LDAPAttributes").''.$langs->trans("Value").'
'.$langs->trans("ErrorFailedToReadLDAP").'
'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')
'; + } -else -{ - dol_print_error('',$ldap->error); -} - - -print '
'; - - $db->close(); llxFooter(); -?> diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 86462d05fae..bd74fc75ef8 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -38,210 +38,213 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $object = new Contact($db); -/* - * Action - */ +$result = $object->fetch($id, $user); -if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) +if ($id > 0) { - $ret = $object->fetch($id); + /* + * Action + */ - // Note: Correct date should be completed with location to have exact GM time of birth. - $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); - $object->birthday_alert = $_POST["birthday_alert"]; + if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) + { + // Note: Correct date should be completed with location to have exact GM time of birth. + $object->birthday = dol_mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); + $object->birthday_alert = $_POST["birthday_alert"]; - $result = $object->update_perso($id, $user); - if ($result > 0) - { - $object->old_name=''; - $object->old_firstname=''; - } - else - { - $error = $object->error; - } + $result = $object->update_perso($id, $user); + if ($result > 0) + { + $object->old_name=''; + $object->old_firstname=''; + } + else + { + $error = $object->error; + } + } } - /* * View */ +$form = new Form($db); + $now=dol_now(); $title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); llxHeader('',$title,'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_Empresas'); -$form = new Form($db); - -$object->fetch($id, $user); - -$head = contact_prepare_head($object); - -dol_fiche_head($head, 'perso', $title, 0, 'contact'); - -if ($action == 'edit') +if ($id > 0) { - /* - * Fiche en mode edition - */ + $head = contact_prepare_head($object); - print '
'; - print ''; - print ''; - print ''; + dol_fiche_head($head, 'perso', $title, 0, 'contact'); - print ''; - - // Ref - print ''; - - // Name - print ''; - print ''; - - // Company - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) + if ($action == 'edit') { - if ($object->socid > 0) + /* + * Fiche en mode edition + */ + + print ''; + print ''; + print ''; + print ''; + + print '
'.$langs->trans("Ref").''; - print $object->id; - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'; + + // Ref + print ''; + + // Name + print ''; + print ''; + + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - $objsoc = new Societe($db); - $objsoc->fetch($object->socid); + if ($object->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($object->socid); - print ''; - } - else - { - print ''; - } - } - - // Civility - print ''; - - // Date To Birth - print ''; - - print ''; - } - else - { - print ''; - } - print ''; - - print "
'.$langs->trans("Ref").''; + print $object->id; + print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print '
'.$langs->trans("UserTitle").''; - print $object->getCivilityLabel(); - print '
'.$langs->trans("DateToBirth").''; - $form=new Form($db); - print $form->select_date($object->birthday,'birthday',0,0,1,"perso"); - print ''.$langs->trans("Alert").': '; - if (! empty($object->birthday_alert)) - { - print '

"; - - print '
'; - print ''; - print '   '; - print ''; - print '
'; - - print "
"; -} -else -{ - /* - * Fiche en mode visu - */ - print ''; - - $linkback = ''.$langs->trans("BackToList").''; - - // Ref - print ''; - - // Name - print ''; - print ''; - - // Company - if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) - { - if ($object->socid > 0) - { - $objsoc = new Societe($db); - $objsoc->fetch($object->socid); - - print ''; + print ''; + } + else + { + print ''; + } } - else - { - print ''; - } - } + // Civility + print ''; - // Civility - print ''; - - // Date To Birth - print ''; - if (! empty($object->birthday)) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - - print ''; + + print ''; + } + else + { + print ''; + } + print ''; + + print "
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback); - print '
'.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''.$langs->trans("Firstname").''.$object->firstname.'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''.$objsoc->getNomUrl(1).'
'.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print '
'.$langs->trans("Company").''; - print $langs->trans("ContactNotLinkedToCompany"); - print '
'.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print '
'.$langs->trans("UserTitle").''; - print $object->getCivilityLabel(); - print '
'.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); - - print '   '; - //var_dump($birthdatearray); - $ageyear=convertSecondToTime($now-$object->birthday,'year')-1970; - $agemonth=convertSecondToTime($now-$object->birthday,'month')-1; - if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; - else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; - else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; - - - print '   -   '; - if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); - else print $langs->trans("BirthdayAlertOff"); + // Date To Birth + print '
'.$langs->trans("DateToBirth").''; + $form=new Form($db); + print $form->select_date($object->birthday,'birthday',0,0,1,"perso"); print ''.$langs->trans("Alert").': '; + if (! empty($object->birthday_alert)) + { + print '

"; + + print '
'; + print ''; + print '   '; + print ''; + print '
'; + + print ""; } else { - print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown").""; - } - print ""; + /* + * Fiche en mode visu + */ + print ''; - print "
"; + $linkback = ''.$langs->trans("BackToList").''; -} + // Ref + print ''.$langs->trans("Ref").''; + print $form->showrefnav($object, 'id', $linkback); + print ''; -dol_fiche_end(); + // Name + print ''.$langs->trans("Lastname").' / '.$langs->trans("Label").''.$object->lastname.''; + print ''.$langs->trans("Firstname").''.$object->firstname.''; -if ($action != 'edit') -{ - // Barre d'actions - if ($user->societe_id == 0) - { - print '
'; - - if ($user->rights->societe->contact->creer) + // Company + if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { - print ''.$langs->trans('Modify').''; + if ($object->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($object->socid); + + print ''.$langs->trans("Company").''.$objsoc->getNomUrl(1).''; + } + + else + { + print ''.$langs->trans("Company").''; + print $langs->trans("ContactNotLinkedToCompany"); + print ''; + } } - print "
"; + // Civility + print ''.$langs->trans("UserTitle").''; + print $object->getCivilityLabel(); + print ''; + + // Date To Birth + print ''; + if (! empty($object->birthday)) + { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + + print ''.$langs->trans("DateToBirth").''.dol_print_date($object->birthday,"day"); + + print '   '; + //var_dump($birthdatearray); + $ageyear=convertSecondToTime($now-$object->birthday,'year')-1970; + $agemonth=convertSecondToTime($now-$object->birthday,'month')-1; + if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')'; + else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')'; + else print '('.$agemonth.' '.$langs->trans("DurationMonth").')'; + + + print '   -   '; + if ($object->birthday_alert) print $langs->trans("BirthdayAlertOn"); + else print $langs->trans("BirthdayAlertOff"); + print ''; + } + else + { + print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown").""; + } + print ""; + + print ""; + + } + + dol_fiche_end(); + + if ($action != 'edit') + { + // Barre d'actions + if ($user->societe_id == 0) + { + print '
'; + + if ($user->rights->societe->contact->creer) + { + print ''.$langs->trans('Modify').''; + } + + print "
"; + } } } @@ -249,4 +252,3 @@ if ($action != 'edit') llxFooter(); $db->close(); -?> diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 76d73133e0f..6e439b7a575 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -35,70 +35,72 @@ $id = GETPOST('id', 'int'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $contact = new Contact($db); -$result=$contact->fetch($id); -$physicalperson=1; - -$company = new Societe($db); -if ($contact->socid) +if ($id > 0) { - $result=$company->fetch($contact->socid); - //print "ee"; + $result=$contact->fetch($id); + + $physicalperson=1; + + $company = new Societe($db); + if ($contact->socid) + { + $result=$company->fetch($contact->socid); + //print "ee"; + } + + // We create VCard + $v = new vCard(); + $v->setProdId('Dolibarr '.DOL_VERSION); + + $v->setUid('DOLIBARR-CONTACTID-'.$contact->id); + $v->setName($contact->lastname, $contact->firstname, "", "", ""); + $v->setFormattedName($contact->getFullName($langs)); + + // By default, all informations are for work (except phone_perso and phone_mobile) + $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); + $v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); + $v->setPhoneNumber($contact->fax, "WORK;FAX"); + + $v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); + $v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK"); + $v->setEmail($contact->email,'internet,pref'); + $v->setNote($contact->note); + + $v->setTitle($contact->poste); + + // Data from linked company + if ($company->id) + { + $v->setURL($company->url, "WORK"); + if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); + if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); + if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); + if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); + // Si contact lie a un tiers non de type "particulier" + if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom); + } + + // Personal informations + $v->setPhoneNumber($contact->phone_perso, "HOME;VOICE"); + if ($contact->birthday) $v->setBirthday($contact->birthday); + + $db->close(); + + + // Renvoi la VCard au navigateur + + $output = $v->getVCard(); + + $filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf" + $filenameurlencoded = dol_sanitizeFileName(urlencode($filename)); + //$filename = dol_sanitizeFileName($filename); + + + header("Content-Disposition: attachment; filename=\"".$filename."\""); + header("Content-Length: ".dol_strlen($output)); + header("Connection: close"); + header("Content-Type: text/x-vcard; name=\"".$filename."\""); + + print $output; } - -// We create VCard -$v = new vCard(); -$v->setProdId('Dolibarr '.DOL_VERSION); - -$v->setUid('DOLIBARR-CONTACTID-'.$contact->id); -$v->setName($contact->lastname, $contact->firstname, "", "", ""); -$v->setFormattedName($contact->getFullName($langs)); - -// By default, all informations are for work (except phone_perso and phone_mobile) -$v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); -$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); -$v->setPhoneNumber($contact->fax, "WORK;FAX"); - -$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); -$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK"); -$v->setEmail($contact->email,'internet,pref'); -$v->setNote($contact->note); - -$v->setTitle($contact->poste); - -// Data from linked company -if ($company->id) -{ - $v->setURL($company->url, "WORK"); - if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); - if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); - if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); - if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); - // Si contact lie a un tiers non de type "particulier" - if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom); -} - -// Personal informations -$v->setPhoneNumber($contact->phone_perso, "HOME;VOICE"); -if ($contact->birthday) $v->setBirthday($contact->birthday); - -$db->close(); - - -// Renvoi la VCard au navigateur - -$output = $v->getVCard(); - -$filename =trim(urldecode($v->getFileName())); // "Nom prenom.vcf" -$filenameurlencoded = dol_sanitizeFileName(urlencode($filename)); -//$filename = dol_sanitizeFileName($filename); - - -header("Content-Disposition: attachment; filename=\"".$filename."\""); -header("Content-Length: ".dol_strlen($output)); -header("Connection: close"); -header("Content-Type: text/x-vcard; name=\"".$filename."\""); - -print $output; - -?> diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ce0d8babbc6..289a2d607c3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -836,7 +836,7 @@ class Form $out.= ''; } - array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->name, 'label'=>$obj->name)); + array_push($outarray, array('key'=>$obj->rowid, 'value'=>$obj->rowid, 'label'=>$label)); $i++; if (($i % 10) == 0) $out.="\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 83fcfca04bc..860acd993a0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -134,9 +134,11 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } // Financial - $tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->deplacement->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled)), - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->deplacement->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire)), - 'module'=>'comptabilite|accounting|facture|deplacement|don|tax'); + $tmpentry = array( + 'enabled' => (!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->facture->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->don->enabled) || !empty($conf->tax->enabled) || !empty($conf->margin->enabled)), + 'perms' => (!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->plancompte->lire) || !empty($user->rights->facture->lire) || !empty($user->rights->deplacement->lire) || !empty($user->rights->don->lire) || !empty($user->rights->tax->charges->lire) || !empty($user->rights->margins->liretous)), + 'module' => 'comptabilite|accounting|facture|deplacement|don|tax' + ); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) { diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 8f0d0836ed4..d4c030f7664 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -40,6 +40,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe'); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('infothirdparty')); +$soc = new Societe($db); /* @@ -59,27 +60,27 @@ $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->e $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); -$soc = new Societe($db); -$soc->fetch($socid); -$soc->info($socid); +if ($socid > 0) +{ + $result = $soc->fetch($socid); -/* - * Affichage onglets - */ -$head = societe_prepare_head($soc); + $soc->info($socid); -dol_fiche_head($head, 'info', $langs->trans("ThirdParty"),0,'company'); + /* + * Affichage onglets + */ + $head = societe_prepare_head($soc); + + dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company'); + print '
'; + dol_print_object_info($soc); + print '
'; -print '
'; -dol_print_object_info($soc); -print '
'; - -print ''; - + dol_fiche_end(); +} llxFooter(); $db->close(); -?> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b24179328fc..99e5da3beb8 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -999,6 +999,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); @@ -1407,6 +1408,7 @@ else // Other attributes $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); From 646ad48bd068d7070b809ac84729ce0d9ed579f6 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 21 Jul 2015 10:50:07 +0200 Subject: [PATCH 4/5] Better fix for not numeric qty or discount --- htdocs/comm/propal/class/propal.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 60cbaa6ae0d..1a800dbf944 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2876,11 +2876,12 @@ class PropaleLigne extends CommonObject if (empty($this->total_localtax2)) $this->total_localtax2=0; if (empty($this->rang)) $this->rang=0; if (empty($this->remise)) $this->remise=0; - if (empty($this->remise_percent)) $this->remise_percent=0; + if (empty($this->remise_percent) || ! is_numeric($this->remise_percent)) $this->remise_percent=0; if (empty($this->info_bits)) $this->info_bits=0; if (empty($this->special_code)) $this->special_code=0; if (empty($this->fk_parent_line)) $this->fk_parent_line=0; if (empty($this->fk_fournprice)) $this->fk_fournprice=0; + if (! is_numeric($this->qty)) $this->qty = 0; if (empty($this->pa_ht)) $this->pa_ht=0; @@ -2910,14 +2911,14 @@ class PropaleLigne extends CommonObject $sql.= " ".($this->fk_product?"'".$this->fk_product."'":"null").","; $sql.= " '".$this->product_type."',"; $sql.= " ".($this->fk_remise_except?"'".$this->fk_remise_except."'":"null").","; - $sql.= " '".price2num($this->qty)."',"; + $sql.= " ".price2num($this->qty).","; $sql.= " ".price2num($this->tva_tx).","; $sql.= " ".price2num($this->localtax1_tx).","; $sql.= " ".price2num($this->localtax2_tx).","; $sql.= " '".$this->localtax1_type."',"; $sql.= " '".$this->localtax2_type."',"; $sql.= " ".($this->subprice?price2num($this->subprice):"null").","; - $sql.= " '".price2num($this->remise_percent)."',"; + $sql.= " ".price2num($this->remise_percent).","; $sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").","; $sql.= " ".price2num($this->total_ht).","; $sql.= " ".price2num($this->total_tva).","; From 7cb564586ea3033fabb92c61756f51722bd287ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Aug 2015 13:52:02 +0200 Subject: [PATCH 5/5] Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything Close #3310 --- ChangeLog | 1 + htdocs/comm/propal/class/propal.class.php | 4 +++- htdocs/commande/class/commande.class.php | 4 +++- htdocs/compta/bank/class/account.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 4 +++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6165077d1ca..7662760ad01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled +Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1a800dbf944..9cbb6e632fb 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2845,10 +2845,12 @@ class PropaleLigne extends CommonObject $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d1a776d3d24..a01e2df27c9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3156,10 +3156,12 @@ class OrderLine extends CommonOrderLine $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 97e7543a030..77df9e6a3b2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1133,7 +1133,6 @@ class AccountLine extends CommonObject } else { - dol_print_error($this->db); return -1; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 0d91d7944b8..79de4dbdb8a 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3471,10 +3471,12 @@ class FactureLigne extends CommonInvoiceLine $this->product_desc = $objp->product_desc; $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } }