Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2013-03-13 11:10:51 +01:00
commit 5149ea9f51
32 changed files with 302 additions and 193 deletions

View File

@ -51,6 +51,7 @@ For developers:
WARNING: If you used external modules, some of them may need to be upgraded due to: WARNING: If you used external modules, some of them may need to be upgraded due to:
- fields of classes were renamed to be normalized (nom, prenom, cp, ville, adresse were - fields of classes were renamed to be normalized (nom, prenom, cp, ville, adresse were
renamed into lastname, firstname, zip, town, address). renamed into lastname, firstname, zip, town, address).
This may also be true for some fields into web services.
- if module use hook pdf_writelinedesc, module may have to add return 1 at end of - if module use hook pdf_writelinedesc, module may have to add return 1 at end of
function to keep same behaviour. function to keep same behaviour.
@ -62,7 +63,7 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: Package for launchpad - Fix: Package for launchpad
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: [ bug #736 ] Missing column in llx_c_chargesociales
- Fix: Localtax2 for Spain must be based into buyer - Fix: Localtax2 for Spain must be based into buyer
- Fix: [ bug #762 ] Bad profit calculation in Reporting
@ -82,6 +83,7 @@ WARNING: If you used external modules, some of them may need to be upgraded due
- Fix: Package for launchpad - Fix: Package for launchpad
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: [ bug #736 ] Missing column in llx_c_chargesociales
- Fix: Localtax2 for Spain must be based into buyer - Fix: Localtax2 for Spain must be based into buyer
- Fix: [ bug #762 ] Bad profit calculation in Reporting

2
README
View File

@ -108,7 +108,7 @@ Other modules:
- RSS - RSS
Miscellanous: Miscellanous:
- Mutli-user, with several permissions levels for each feature. - Multi-user, with several permissions levels for each feature.
- Serveral menu managers (can be used by internal users, as a back-office, - Serveral menu managers (can be used by internal users, as a back-office,
with a particular menu, or by external users, as a front-office, with with a particular menu, or by external users, as a front-office, with
another menu and permissions). another menu and permissions).

View File

@ -122,7 +122,7 @@ V - CE QUE DOLIBARR NE PEUT PAS FAIRE (TACHES A FAIRE)
Voici un liste de fonctionnalites pas encore gérées par Dolibarr: Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
- Pas de compta analytique (uniquement gestion de trésorerie). - Pas de compta analytique (uniquement gestion de trésorerie).
- Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise). - Dolibarr ne gère qu'une seule monnaie à la fois (mono-devise).
- Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MutliCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données. - Dolibarr ne gère en standard qu'une société/institution/association (mono-société). Pour en gérer plusieurs (comme vos filiales), il faut, soit faire plusieurs installations de Dolibarr, soit installer le module MultiCompany qui permet de gérer n société/institutions/associations dans une seule instance par une isolation logique des données.
- Ne gère pas la double tva (Fédérale / provinciale) du canada. - Ne gère pas la double tva (Fédérale / provinciale) du canada.
- Dolibarr ne contient pas de module de Gestion de la paie. - Dolibarr ne contient pas de module de Gestion de la paie.
- Les taches du module de gestion de projets n'ont pas de dépendance entre elle. - Les taches du module de gestion de projets n'ont pas de dépendance entre elle.

View File

@ -105,7 +105,7 @@ See ChangeLog file found into package.
### Miscellanous: ### Miscellanous:
- Mutli-user, with several permissions levels for each feature. - Multi-user, with several permissions levels for each feature.
- Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions). - Serveral menu managers (can be used by internal users, as a back-office, with a particular menu, or by external users, as a front-office, with another menu and permissions).
- Very user friendly and easy to use. - Very user friendly and easy to use.
- Optional WYSIWYG forms, optional Ajax forms. - Optional WYSIWYG forms, optional Ajax forms.

View File

@ -555,7 +555,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
if (isset($totentrees[$annee]) || isset($totsorties[$annee])) if (isset($totentrees[$annee]) || isset($totsorties[$annee]))
{ {
$in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0); $in=(isset($totentrees[$annee])?price2num($totentrees[$annee], 'MT'):0);
$out=(isset($totsorties[$annee])?price2num($totsorties[$annee],' MT'):0); $out=(isset($totsorties[$annee])?price2num($totsorties[$annee],'MT'):0);
print price($in-$out).'</td>'; print price($in-$out).'</td>';
// print '<td>&nbsp;</td>'; // print '<td>&nbsp;</td>';
} }

View File

@ -109,10 +109,13 @@ function delivery_prepare_head($object)
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
// complete_head_from_modules use $object->id for this link so we temporary change it
$tmpObjectId = $object->id;
$object->id = $object->origin_id;
complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery'); complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery');
complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery','remove'); complete_head_from_modules($conf,$langs,$object,$head,$h,'delivery','remove');
$object->id = $tmpObjectId;
return $head; return $head;
} }

View File

@ -650,7 +650,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{ {
$langs->load("orders"); $langs->load("orders");
$newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers'); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers",$langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers');
$newmenu->add("/societe/societe.php?leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/fiche.php?action=create", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer);
$newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/fourn/commande/liste.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire);
$newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); $newmenu->add("/commande/stats/index.php?leftmenu=orders_suppliers&amp;mode=supplier", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire);
} }

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2012 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* *
@ -926,6 +926,9 @@ class CommandeFournisseur extends CommonOrder
$sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande_fournisseur (";
$sql.= "ref"; $sql.= "ref";
$sql.= ", ref_supplier";
$sql.= ", note";
$sql.= ", note_public";
$sql.= ", entity"; $sql.= ", entity";
$sql.= ", fk_soc"; $sql.= ", fk_soc";
$sql.= ", date_creation"; $sql.= ", date_creation";
@ -938,6 +941,9 @@ class CommandeFournisseur extends CommonOrder
$sql.= ") "; $sql.= ") ";
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "''"; $sql.= "''";
$sql.= ", '".$this->ref_supplier."'";
$sql.= ", '".$this->note."'";
$sql.= ", '".$this->note_public."'";
$sql.= ", ".$conf->entity; $sql.= ", ".$conf->entity;
$sql.= ", ".$this->socid; $sql.= ", ".$this->socid;
$sql.= ", ".$this->db->idate($now); $sql.= ", ".$this->db->idate($now);

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
* *
@ -82,7 +82,7 @@ if ($id > 0 || ! empty($ref))
$ret = $object->fetch_thirdparty(); $ret = $object->fetch_thirdparty();
if ($ret < 0) dol_print_error($db,$object->error); if ($ret < 0) dol_print_error($db,$object->error);
} }
else if (! empty($socid)) else if (! empty($socid) && $socid > 0)
{ {
$fourn = new Fournisseur($db); $fourn = new Fournisseur($db);
$ret=$fourn->fetch($socid); $ret=$fourn->fetch($socid);
@ -657,33 +657,47 @@ else if ($action == 'remove_file' && $object->id > 0 && $user->rights->fournisse
/* /*
* Create an order * Create an order
*/ */
else if ($action == 'create' && ! empty($object->socid) && $user->rights->fournisseur->commande->creer) else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{ {
$error=0; $error=0;
$db->begin(); if ($socid <1)
$id=$object->create($user);
if (! $id > 0)
{ {
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'</div>';
$action='create';
$error++; $error++;
setEventMessage($object->error, 'errors');
} }
if (! $error) if (! $error)
{ {
if ($comclientid != '') $db->begin();
// Creation commande
$object->ref_supplier = GETPOST('refsupplier');
$object->socid = $socid;
$object->note = GETPOST('note');
$object->note_public = GETPOST('note_public');
$id = $object->create($user);
if ($id < 0)
{ {
$object->updateFromCommandeClient($user, $id, $comclientid); $error++;
} }
$ret=$object->fetch($id); // Reload to get new records if ($error)
{
$db->commit(); $langs->load("errors");
$db->rollback();
$mesg='<div class="error">'.$langs->trans($object->error).'</div>';
$action='create';
$_GET['socid']=$_POST['socid'];
} }
else else
{ {
$db->rollback(); $db->commit();
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
} }
} }
@ -942,8 +956,68 @@ $productstatic = new Product($db);
/* *************************************************************************** */ /* *************************************************************************** */
$now=dol_now(); $now=dol_now();
if ($action=="create")
{
print_fiche_titre($langs->trans('NewOrder'));
if (! empty($object->id)) dol_htmloutput_mesg($mesg);
$societe='';
if ($socid>0)
{
$societe=new Societe($db);
$societe->fetch($socid);
}
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<table class="border" width="100%">';
// Ref
print '<tr><td>'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
// Third party
print '<tr><td class="fieldrequired">'.$langs->trans('Supplier').'</td>';
print '<td>';
if ($socid > 0)
{
print $societe->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$socid.'">';
}
else
{
print $form->select_company((empty($socid)?'':$socid),'socid','s.fournisseur = 1',1);
}
print '</td>';
// Ref supplier
print '<tr><td>'.$langs->trans('RefSupplier').'</td><td><input name="refsupplier" type="text"></td>';
print '</tr>';
print '</td></tr>';
print '<tr><td>'.$langs->trans('Note').'</td>';
print '<td><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
print '</tr>';
print '<tr><td>'.$langs->trans('NotePublic').'</td>';
print '<td><textarea name="note_public" wrap="soft" cols="60" rows="'.ROWS_5.'"></textarea></td>';
print '</tr>';
// Other options
$parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
// Bouton "Create Draft"
print "</table>\n";
print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></center>';
print "</form>\n";
}
elseif (! empty($object->id))
{ {
$author = new User($db); $author = new User($db);
$author->fetch($object->user_author_id); $author->fetch($object->user_author_id);

View File

@ -53,11 +53,11 @@ insert into llx_c_pays (rowid,code,libelle) values (18, 'HU', 'Hongrie' )
insert into llx_c_pays (rowid,code,libelle) values (19, 'RU', 'Russia' ); insert into llx_c_pays (rowid,code,libelle) values (19, 'RU', 'Russia' );
insert into llx_c_pays (rowid,code,libelle) values (20, 'SE', 'Sweden' ); insert into llx_c_pays (rowid,code,libelle) values (20, 'SE', 'Sweden' );
insert into llx_c_pays (rowid,code,libelle) values (21, 'CI', 'Côte d''Ivoire' ); insert into llx_c_pays (rowid,code,libelle) values (21, 'CI', 'Côte d''Ivoire' );
insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Sénégal' ); insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Senegal' );
insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' ); insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' );
insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' ); insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' );
insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' ); insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' );
insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Arabie Saoudite'); insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Saudi Arabia' );
insert into llx_c_pays (rowid,code,libelle) values (27, 'MC', 'Monaco' ); insert into llx_c_pays (rowid,code,libelle) values (27, 'MC', 'Monaco' );
insert into llx_c_pays (rowid,code,libelle) values (28, 'AU', 'Australia' ); insert into llx_c_pays (rowid,code,libelle) values (28, 'AU', 'Australia' );
insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapour' ); insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapour' );

View File

@ -183,6 +183,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (18
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884,188, '5','0','VAT reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884,188, '5','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883,188, '0','0','VAT Rate 0', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883,188, '0','0','VAT Rate 0', 1);
-- SAUDI ARABIA (id country=26)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT Rate 0', 1);
-- SAN SALVADOR (id country=86) -- SAN SALVADOR (id country=86)
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (861, 86, '13', '0', 'IVA 13', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (861, 86, '13', '0', 'IVA 13', 1);
INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (862, 86, '0', '0', 'SIN IVA', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (862, 86, '0', '0', 'SIN IVA', 1);

View File

@ -925,3 +925,5 @@ UPDATE llx_c_action_trigger SET code='FICHINTER_VALIDATE' WHERE code='FICHEINTER
UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement='01' AND fk_region=419; UPDATE llx_c_departements SET ncc='ALAVA', nom='Álava' WHERE code_departement='01' AND fk_region=419;
ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseur;
UPDATE llx_const set name='PRODUIT_MULTI_PRICES' where name='PRODUIT_MUTLI_PRICES';

View File

@ -213,7 +213,7 @@ ModuleFamilyProducts=إدارة المنتجات
ModuleFamilyHr=إدارة الموارد البشرية ModuleFamilyHr=إدارة الموارد البشرية
ModuleFamilyProjects=مشاريع / العمل التعاوني ModuleFamilyProjects=مشاريع / العمل التعاوني
ModuleFamilyOther=أخرى ModuleFamilyOther=أخرى
ModuleFamilyTechnic=Mutli بين وحدات وأدوات ModuleFamilyTechnic=Multi بين وحدات وأدوات
ModuleFamilyExperimental=نماذج تجريبية ModuleFamilyExperimental=نماذج تجريبية
ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة) ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة)
ModuleFamilyECM=إدارة المحتوى في المؤسسة ModuleFamilyECM=إدارة المحتوى في المؤسسة

View File

@ -937,6 +937,7 @@ ExtraFieldsThirdParties=Atributs adicionals (tercers)
ExtraFieldsContacts=Atributs adicionals (contactes/adreçes) ExtraFieldsContacts=Atributs adicionals (contactes/adreçes)
ExtraFieldsMember=Atributs complementaris (membres) ExtraFieldsMember=Atributs complementaris (membres)
ExtraFieldsMemberType=Atributs complementaris (tipus de membres) ExtraFieldsMemberType=Atributs complementaris (tipus de membres)
ExtraFieldsCustomerInvoices=Atributs complementaris (factures a clients)
ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte. ExtraFieldHasWrongValue=L'atribut %s te un valor incorrecte.
AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais AlphaNumOnlyCharsAndNoSpace=només carateres alfanumèrics sense espais
SendingMailSetup=Configuració de l'enviament per mail SendingMailSetup=Configuració de l'enviament per mail

View File

@ -199,7 +199,7 @@ ModuleFamilyProducts=Produkter Management
ModuleFamilyHr=Human Resource Management ModuleFamilyHr=Human Resource Management
ModuleFamilyProjects=Projekter / samarbejde ModuleFamilyProjects=Projekter / samarbejde
ModuleFamilyOther=Anden ModuleFamilyOther=Anden
ModuleFamilyTechnic=Mutli-moduler værktøjer ModuleFamilyTechnic=Multi-moduler værktøjer
ModuleFamilyExperimental=Eksperimentel moduler ModuleFamilyExperimental=Eksperimentel moduler
ModuleFamilyFinancial=Finansielle Modules (Regnskabsmæssig / Treasury) ModuleFamilyFinancial=Finansielle Modules (Regnskabsmæssig / Treasury)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -262,7 +262,7 @@ ModuleFamilyProducts=Products Management
ModuleFamilyHr=Human Resource Management ModuleFamilyHr=Human Resource Management
ModuleFamilyProjects=Projects/Collaborative work ModuleFamilyProjects=Projects/Collaborative work
ModuleFamilyOther=Other ModuleFamilyOther=Other
ModuleFamilyTechnic=Mutli-modules tools ModuleFamilyTechnic=Multi-modules tools
ModuleFamilyExperimental=Experimental modules ModuleFamilyExperimental=Experimental modules
ModuleFamilyFinancial=Financial Modules (Accounting/Treasury) ModuleFamilyFinancial=Financial Modules (Accounting/Treasury)
ModuleFamilyECM=Electronic Content Management (ECM) ModuleFamilyECM=Electronic Content Management (ECM)

View File

@ -938,6 +938,7 @@ ExtraFieldsThirdParties=Atributos adicionales (terceros)
ExtraFieldsContacts=Atributos adicionales (contactos/direcciones) ExtraFieldsContacts=Atributos adicionales (contactos/direcciones)
ExtraFieldsMember=Atributos complementarios (miembros) ExtraFieldsMember=Atributos complementarios (miembros)
ExtraFieldsMemberType=Atributos complementarios (tipos de miembros) ExtraFieldsMemberType=Atributos complementarios (tipos de miembros)
ExtraFieldsCustomerInvoices=Atributos complementarios (facturas a clientes)
ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto. ExtraFieldHasWrongValue=El atributo %s tiene un valor incorrecto.
AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios AlphaNumOnlyCharsAndNoSpace=solamente caracteres alfanuméricos sin espacios
SendingMailSetup=Configuración del envío por mail SendingMailSetup=Configuración del envío por mail

View File

@ -259,7 +259,7 @@ ModuleFamilyProducts=Tooted juhtimine
ModuleFamilyHr=Human Resource Management ModuleFamilyHr=Human Resource Management
ModuleFamilyProjects=Projektid / koostööprojektid töö ModuleFamilyProjects=Projektid / koostööprojektid töö
ModuleFamilyOther=Teine ModuleFamilyOther=Teine
ModuleFamilyTechnic=Mutli-moodulid tööriistad ModuleFamilyTechnic=Multi-moodulid tööriistad
ModuleFamilyExperimental=Eksperimentaalse moodulid ModuleFamilyExperimental=Eksperimentaalse moodulid
ModuleFamilyFinancial=Financial Modules (Raamatupidamine / Treasury) ModuleFamilyFinancial=Financial Modules (Raamatupidamine / Treasury)
ModuleFamilyECM=Electronic sisuhaldus (ECM) ModuleFamilyECM=Electronic sisuhaldus (ECM)

View File

@ -221,7 +221,7 @@ ModuleFamilyProducts= سیسیتم کالاها
ModuleFamilyHr= سیستم استخدامی ModuleFamilyHr= سیستم استخدامی
ModuleFamilyProjects= سیستم پروژه ها ModuleFamilyProjects= سیستم پروژه ها
ModuleFamilyOther= دیگر سیستم ها ModuleFamilyOther= دیگر سیستم ها
ModuleFamilyTechnic=Mutli بين وحدات وأدوات ModuleFamilyTechnic=Multi بين وحدات وأدوات
ModuleFamilyExperimental=نماذج تجريبية ModuleFamilyExperimental=نماذج تجريبية
ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة) ModuleFamilyFinancial=الوحدات المالية (المحاسبة / الخزانة)
ModuleFamilyECM=تولید محتوی الکترونیکی ModuleFamilyECM=تولید محتوی الکترونیکی

View File

@ -197,7 +197,7 @@ ModuleFamilyProducts=Tuotteet Management
ModuleFamilyHr=Human Resource Management ModuleFamilyHr=Human Resource Management
ModuleFamilyProjects=Projektit / Yhteistyöhankkeet työn ModuleFamilyProjects=Projektit / Yhteistyöhankkeet työn
ModuleFamilyOther=Muu ModuleFamilyOther=Muu
ModuleFamilyTechnic=Mutli-modules työkalut ModuleFamilyTechnic=Multi-modules työkalut
ModuleFamilyExperimental=Kokeellinen modules ModuleFamilyExperimental=Kokeellinen modules
ModuleFamilyFinancial=Financial Modules (kirjanpidon / Treasury) ModuleFamilyFinancial=Financial Modules (kirjanpidon / Treasury)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -259,7 +259,7 @@ ModuleFamilyProducts=מוצרי ניהול
ModuleFamilyHr=ניהול משאבי אנוש ModuleFamilyHr=ניהול משאבי אנוש
ModuleFamilyProjects=פרויקטים / עבודה שיתופית ModuleFamilyProjects=פרויקטים / עבודה שיתופית
ModuleFamilyOther=אחר ModuleFamilyOther=אחר
ModuleFamilyTechnic=Mutli מודולים כלים ModuleFamilyTechnic=Multi מודולים כלים
ModuleFamilyExperimental=הניסוי מודולים ModuleFamilyExperimental=הניסוי מודולים
ModuleFamilyFinancial=מודולים פיננסיים (חשבונאות / משרד האוצר) ModuleFamilyFinancial=מודולים פיננסיים (חשבונאות / משרד האוצר)
ModuleFamilyECM=ניהול תוכן אלקטרוני (ECM) ModuleFamilyECM=ניהול תוכן אלקטרוני (ECM)

View File

@ -259,7 +259,7 @@ ModuleFamilyProducts=Termékek kezelése
ModuleFamilyHr=Az emberi erőforrás menedzsment ModuleFamilyHr=Az emberi erőforrás menedzsment
ModuleFamilyProjects=Projektek / kollaboratív munkát ModuleFamilyProjects=Projektek / kollaboratív munkát
ModuleFamilyOther=Más ModuleFamilyOther=Más
ModuleFamilyTechnic=Mutli-modulok eszközök ModuleFamilyTechnic=Multi-modulok eszközök
ModuleFamilyExperimental=Kísérleti modulok ModuleFamilyExperimental=Kísérleti modulok
ModuleFamilyFinancial=Pénzügyi modulok (Számviteli / Kincstár) ModuleFamilyFinancial=Pénzügyi modulok (Számviteli / Kincstár)
ModuleFamilyECM=Elektronikus Content Management (ECM) ModuleFamilyECM=Elektronikus Content Management (ECM)

View File

@ -234,7 +234,7 @@ ModuleFamilyProducts=Vörur Stjórn
ModuleFamilyHr=Mannauðsstjórnun ModuleFamilyHr=Mannauðsstjórnun
ModuleFamilyProjects=Verkefni / samvinna vinna ModuleFamilyProjects=Verkefni / samvinna vinna
ModuleFamilyOther=Önnur ModuleFamilyOther=Önnur
ModuleFamilyTechnic=Mutli-einingar verkfæri ModuleFamilyTechnic=Multi-einingar verkfæri
ModuleFamilyExperimental=Experimental mát ModuleFamilyExperimental=Experimental mát
ModuleFamilyFinancial=Financial einingar (Bókhald / ríkissjóðs) ModuleFamilyFinancial=Financial einingar (Bókhald / ríkissjóðs)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -259,7 +259,7 @@ ModuleFamilyProducts=製品の管理
ModuleFamilyHr=人的資源管理 ModuleFamilyHr=人的資源管理
ModuleFamilyProjects=プロジェクト/共同作業 ModuleFamilyProjects=プロジェクト/共同作業
ModuleFamilyOther=その他 ModuleFamilyOther=その他
ModuleFamilyTechnic=Mutli-モジュールツール ModuleFamilyTechnic=Multi-モジュールツール
ModuleFamilyExperimental=実験的なモジュール ModuleFamilyExperimental=実験的なモジュール
ModuleFamilyFinancial=金融モジュール(会計/財務) ModuleFamilyFinancial=金融モジュール(会計/財務)
ModuleFamilyECM=電子コンテンツ管理(ECM) ModuleFamilyECM=電子コンテンツ管理(ECM)

View File

@ -200,7 +200,7 @@ ModuleFamilyProducts=Produkty Management
ModuleFamilyHr=Zarządzanie zasobami ludzkimi ModuleFamilyHr=Zarządzanie zasobami ludzkimi
ModuleFamilyProjects=Projekty / współpracy ModuleFamilyProjects=Projekty / współpracy
ModuleFamilyOther=Inny ModuleFamilyOther=Inny
ModuleFamilyTechnic=Mutli-modules narzędzia ModuleFamilyTechnic=Multi-modules narzędzia
ModuleFamilyExperimental=Eksperymentalne modules ModuleFamilyExperimental=Eksperymentalne modules
ModuleFamilyFinancial=Moduły finansowe (Księgowość / Skarbu) ModuleFamilyFinancial=Moduły finansowe (Księgowość / Skarbu)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -198,7 +198,7 @@ ModuleFamilyProducts=Produse de Management
ModuleFamilyHr=Managementul resurselor umane ModuleFamilyHr=Managementul resurselor umane
ModuleFamilyProjects=Proiecte / Colaborativă munca ModuleFamilyProjects=Proiecte / Colaborativă munca
ModuleFamilyOther=Alt ModuleFamilyOther=Alt
ModuleFamilyTechnic=Mutli-module de unelte ModuleFamilyTechnic=Multi-module de unelte
ModuleFamilyExperimental=Experimentale module ModuleFamilyExperimental=Experimentale module
ModuleFamilyFinancial=Module financiar (Contabilitate / Trezoreriei) ModuleFamilyFinancial=Module financiar (Contabilitate / Trezoreriei)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -197,7 +197,7 @@ ModuleFamilyProducts=Продукты управления
ModuleFamilyHr=Кадровый менеджмент ModuleFamilyHr=Кадровый менеджмент
ModuleFamilyProjects=Проекты / Совместная работа ModuleFamilyProjects=Проекты / Совместная работа
ModuleFamilyOther=Другой ModuleFamilyOther=Другой
ModuleFamilyTechnic=Mutli-модулей инструменты ModuleFamilyTechnic=Multi-модулей инструменты
ModuleFamilyExperimental=Экспериментальный модуль ModuleFamilyExperimental=Экспериментальный модуль
ModuleFamilyFinancial=Финансовые модули (Бухгалтерия / Казначейство) ModuleFamilyFinancial=Финансовые модули (Бухгалтерия / Казначейство)
ModuleFamilyECM=ECM ModuleFamilyECM=ECM

View File

@ -539,11 +539,11 @@ if ($resql)
print '<td align="right">'.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product print '<td align="right">'.(price2num($obj->pmp)?price(price2num($obj->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product
// Sell price // Sell price
print '<td align="right">'; print '<td align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price,'MU')); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'));
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; // Ditto : Show PMP from movement or from product print '</td>'; // Ditto : Show PMP from movement or from product
print '<td align="right">'; print '<td align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</tr>'; ; print '</tr>'; ;
$total += $obj->reel; $total += $obj->reel;
@ -564,11 +564,11 @@ print '<td class="liste_total" align="right">';
print price(price2num($totalvalue,'MT')); print price(price2num($totalvalue,'MT'));
print '</td>'; print '</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print ($total?price($totalvaluesell/$total):'&nbsp;'); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print ($total?price($totalvaluesell/$total):'&nbsp;');
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; print '</td>';
print '<td class="liste_total" align="right">'; print '<td class="liste_total" align="right">';
if (empty($conf->global->PRODUIT_MUTLI_PRICES)) print price(price2num($totalvaluesell,'MT')); if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($totalvaluesell,'MT'));
else print $langs->trans("Variable"); else print $langs->trans("Variable");
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -96,7 +96,7 @@ print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
$max=10; $max=10;
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut, u.entity, u.ldap_sid,"; $sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut, u.entity, u.ldap_sid,";
$sql.= " s.nom, s.canvas"; $sql.= " s.nom as name, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity))) if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
@ -126,7 +126,7 @@ if ($resql)
$var=!$var; $var=!$var;
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print '<td><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->firstname.' '.$obj->name.'</a>'; print '<td><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($obj->firstname,$obj->lastname).'</a>';
if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity)
{ {
print img_picto($langs->trans("SuperAdministrator"),'redstar'); print img_picto($langs->trans("SuperAdministrator"),'redstar');
@ -141,7 +141,7 @@ if ($resql)
if ($obj->fk_societe) if ($obj->fk_societe)
{ {
$companystatic->id=$obj->fk_societe; $companystatic->id=$obj->fk_societe;
$companystatic->nom=$obj->nom; $companystatic->name=$obj->name;
$companystatic->canvas=$obj->canvas; $companystatic->canvas=$obj->canvas;
print $companystatic->getNomUrl(1); print $companystatic->getNomUrl(1);
} }

View File

@ -67,7 +67,7 @@ $server->wsdl->addComplexType(
'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'), 'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'),
'login' => array('name'=>'login','type'=>'xsd:string'), 'login' => array('name'=>'login','type'=>'xsd:string'),
'password' => array('name'=>'password','type'=>'xsd:string'), 'password' => array('name'=>'password','type'=>'xsd:string'),
'entity' => array('name'=>'entity','type'=>'xsd:string'), 'entity' => array('name'=>'entity','type'=>'xsd:string')
) )
); );
// Define WSDL Return object // Define WSDL Return object
@ -377,6 +377,9 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
$errorcode='';$errorlabel=''; $errorcode='';$errorlabel='';
$error=0; $error=0;
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
if ($fuser->societe_id) $socid=$fuser->societe_id;
// Check parameters // Check parameters
if (! $error && empty($idthirdparty)) if (! $error && empty($idthirdparty))
{ {
@ -394,8 +397,8 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
//$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid'; //$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product = p.rowid';
//$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'"; //$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'";
//$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'"; //$sql.=" WHERE f.fk_soc = s.rowid AND nom = '".$db->escape($idthirdparty)."'";
$sql.=" WHERE f.fk_soc = ".$db->escape($idthirdparty); $sql.=" WHERE f.entity = ".$conf->entity;
$sql.=" AND f.entity = ".$conf->entity; if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@ -410,6 +413,13 @@ function getInvoicesForThirdParty($authentication,$idthirdparty)
$invoice=new Facture($db); $invoice=new Facture($db);
$invoice->fetch($obj->facid); $invoice->fetch($obj->facid);
// Sécurité pour utilisateur externe
if( $socid && ( $socid != $order->socid) )
{
$error++;
$errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request';
}
// Define lines of invoice // Define lines of invoice
$linesresp=array(); $linesresp=array();
foreach($invoice->lines as $line) foreach($invoice->lines as $line)

View File

@ -35,6 +35,8 @@ require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
dol_syslog("Call Dolibarr webservices interfaces"); dol_syslog("Call Dolibarr webservices interfaces");
$langs->load("main");
// Enable and test if module web services is enabled // Enable and test if module web services is enabled
if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) if (empty($conf->global->MAIN_MODULE_WEBSERVICES))
{ {
@ -54,7 +56,7 @@ $server->configureWSDL('WebServicesDolibarrOrder',$ns);
$server->wsdl->schemaTargetNamespace=$ns; $server->wsdl->schemaTargetNamespace=$ns;
// Define WSDL content // Define WSDL Authentication object
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'authentication', 'authentication',
'complexType', 'complexType',
@ -69,7 +71,20 @@ $server->wsdl->addComplexType(
'entity' => array('name'=>'entity','type'=>'xsd:string') 'entity' => array('name'=>'entity','type'=>'xsd:string')
) )
); );
// Define WSDL Return object
$server->wsdl->addComplexType(
'result',
'complexType',
'struct',
'all',
'',
array(
'result_code' => array('name'=>'result_code','type'=>'xsd:string'),
'result_label' => array('name'=>'result_label','type'=>'xsd:string'),
)
);
// Define other specific objects
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'line', 'line',
'complexType', 'complexType',
@ -78,34 +93,34 @@ $server->wsdl->addComplexType(
'', '',
array( array(
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:int'),
'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'), 'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'),
'fk_parent_line' => array('name'=>'fk_parent_line','type'=>'xsd:int'), 'fk_parent_line' => array('name'=>'fk_parent_line','type'=>'xsd:int'),
'desc' => array('name'=>'desc','type'=>'xsd:string'), 'desc' => array('name'=>'desc','type'=>'xsd:string'),
'qty' => array('name'=>'qty','type'=>'xsd:int'), 'qty' => array('name'=>'qty','type'=>'xsd:double'),
'price' => array('name'=>'price','type'=>'xsd:double'), 'price' => array('name'=>'price','type'=>'xsd:double'),
'subprice' => array('name'=>'subprice','type'=>'xsd:double'), 'unitprice' => array('name'=>'unitprice','type'=>'xsd:double'),
'tva_tx' => array('name'=>'tva_tx','type'=>'xsd:double'), 'vat_rate' => array('name'=>'vat_rate','type'=>'xsd:double'),
'remise' => array('name'=>'remise','type'=>'xsd:double'), 'remise' => array('name'=>'remise','type'=>'xsd:double'),
'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:double'), 'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:double'),
'fk_product' => array('name'=>'fk_product','type'=>'xsd:int'), 'total_net' => array('name'=>'total_net','type'=>'xsd:double'),
'product_type' => array('name'=>'product_type','type'=>'xsd:int'), 'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'),
'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'), 'total' => array('name'=>'total','type'=>'xsd:double'),
'total_tva' => array('name'=>'totaltva','type'=>'xsd:double'),
'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'),
'date_start' => array('name'=>'date_start','type'=>'xsd:string'), 'date_start' => array('name'=>'date_start','type'=>'xsd:date'),
'date_end' => array('name'=>'date_end','type'=>'xsd:string'), 'date_end' => array('name'=>'date_end','type'=>'xsd:date'),
// From product // From product
'product_id' => array('name'=>'product_id','type'=>'xsd:int'),
'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'),
'product_label' => array('name'=>'product_label','type'=>'xsd:string'), 'product_label' => array('name'=>'product_label','type'=>'xsd:string'),
'product_desc' => array('name'=>'product_desc','type'=>'xsd:string') 'product_desc' => array('name'=>'product_desc','type'=>'xsd:string')
) )
); );
$server->wsdl->addComplexType( /*$server->wsdl->addComplexType(
'LinesArray', 'LinesArray',
'complexType', 'complexType',
'array', 'array',
@ -119,8 +134,7 @@ $server->wsdl->addComplexType(
) )
), ),
'tns:line' 'tns:line'
); );*/
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'LinesArray2', 'LinesArray2',
'complexType', 'complexType',
@ -149,23 +163,25 @@ $server->wsdl->addComplexType(
'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'), 'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'),
'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'),
'ref_int' => array('name'=>'ref_int','type'=>'xsd:string'), 'ref_int' => array('name'=>'ref_int','type'=>'xsd:string'),
'socid' => array('name'=>'socid','type'=>'xsd:int'), 'thirdparty_id' => array('name'=>'thirdparty_id','type'=>'xsd:int'),
'statut' => array('name'=>'statut','type'=>'xsd:int'), 'status' => array('name'=>'status','type'=>'xsd:int'),
'facturee' => array('name'=>'facturee','type'=>'xsd:string'), 'facturee' => array('name'=>'facturee','type'=>'xsd:string'),
'total_ht' => array('name'=>'total_ht','type'=>'xsd:double'), 'total_net' => array('name'=>'total_net','type'=>'xsd:double'),
'total_tva' => array('name'=>'total_tva','type'=>'xsd:double'), 'total_vat' => array('name'=>'total_vat','type'=>'xsd:double'),
'total_localtax1' => array('name'=>'total_localtax1','type'=>'xsd:double'), 'total_localtax1' => array('name'=>'total_localtax1','type'=>'xsd:double'),
'total_localtax2' => array('name'=>'total_localtax2','type'=>'xsd:double'), 'total_localtax2' => array('name'=>'total_localtax2','type'=>'xsd:double'),
'total_ttc' => array('name'=>'total_ttc','type'=>'xsd:double'), 'total' => array('name'=>'total','type'=>'xsd:double'),
'date' => array('name'=>'date','type'=>'xsd:date'), 'date' => array('name'=>'date','type'=>'xsd:date'),
'date_commande' => array('name'=>'date_commande','type'=>'xsd:date'), 'date_creation' => array('name'=>'date_creation','type'=>'xsd:dateTime'),
'date_validation' => array('name'=>'date_validation','type'=>'xsd:dateTime'),
'date_modification' => array('name'=>'date_modification','type'=>'xsd:dateTime'),
'remise' => array('name'=>'remise','type'=>'xsd:string'), 'remise' => array('name'=>'remise','type'=>'xsd:string'),
'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:string'), 'remise_percent' => array('name'=>'remise_percent','type'=>'xsd:string'),
'remise_absolue' => array('name'=>'remise_absolue','type'=>'xsd:string'), 'remise_absolue' => array('name'=>'remise_absolue','type'=>'xsd:string'),
'source' => array('name'=>'source','type'=>'xsd:string'), 'source' => array('name'=>'source','type'=>'xsd:string'),
'note' => array('name'=>'note','type'=>'xsd:string'), 'note' => array('name'=>'note','type'=>'xsd:string'),
'note_public' => array('name'=>'note_public','type'=>'xsd:string'), 'note_public' => array('name'=>'note_public','type'=>'xsd:string'),
'fk_project' => array('name'=>'fk_project','type'=>'xsd:string'), 'project_id' => array('name'=>'project_id','type'=>'xsd:string'),
'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'), 'mode_reglement_id' => array('name'=>'mode_reglement_id','type'=>'xsd:string'),
'mode_reglement_code' => array('name'=>'mode_reglement_code','type'=>'xsd:string'), 'mode_reglement_code' => array('name'=>'mode_reglement_code','type'=>'xsd:string'),
@ -179,10 +195,10 @@ $server->wsdl->addComplexType(
'fk_delivery_address' => array('name'=>'fk_delivery_address','type'=>'xsd:int'), 'fk_delivery_address' => array('name'=>'fk_delivery_address','type'=>'xsd:int'),
'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'), 'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'),
'lines' => array('name'=>'lines','type'=>'tns:LinesArray') 'lines' => array('name'=>'lines','type'=>'tns:LinesArray2')
) )
); );
/*
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'OrdersArray', 'OrdersArray',
'complexType', 'complexType',
@ -197,8 +213,7 @@ $server->wsdl->addComplexType(
) )
), ),
'tns:order' 'tns:order'
); );*/
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'OrdersArray2', 'OrdersArray2',
'complexType', 'complexType',
@ -207,32 +222,14 @@ $server->wsdl->addComplexType(
'', '',
array( array(
'order' => array( 'order' => array(
'name' => 'invoice', 'name' => 'order',
'type' => 'tns:invoice', 'type' => 'tns:order',
'minOccurs' => '0', 'minOccurs' => '0',
'maxOccurs' => 'unbounded' 'maxOccurs' => 'unbounded'
) )
) )
); );
$server->wsdl->addComplexType(
'result',
'complexType',
'struct',
'all',
'',
array(
'result_code' => array(
'name'=>'result_code',
'type'=>'xsd:string'
),
'result_label' => array(
'name'=>'result_label',
'type'=>'xsd:string'
),
)
);
// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped // 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped
@ -268,7 +265,7 @@ $server->register(
$server->register( $server->register(
'createOrder', 'createOrder',
array('authentication'=>'tns:authentication','order'=>'tns:order'), // Entry values array('authentication'=>'tns:authentication','order'=>'tns:order'), // Entry values
array('result'=>'tns:result','id'=>'xsd:string'), // Exit values array('result'=>'tns:result','id'=>'xsd:string','ref'=>'xsd:string'), // Exit values
$ns, $ns,
$ns.'#createOrder', $ns.'#createOrder',
$styledoc, $styledoc,
@ -355,14 +352,14 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='')
'qty'=>$line->qty, 'qty'=>$line->qty,
'price'=>$line->price, 'price'=>$line->price,
'subprice'=>$line->subprice, 'subprice'=>$line->subprice,
'tva_tx'=>$line->tva_tx, 'vat_rate'=>$line->tva_tx,
'remise'=>$line->remise, 'remise'=>$line->remise,
'remise_percent'=>$line->remise_percent, 'remise_percent'=>$line->remise_percent,
'fk_product'=>$line->fk_product, 'fk_product'=>$line->fk_product,
'product_type'=>$line->product_type, 'product_type'=>$line->product_type,
'total_ht'=>$line->total_ht, 'total_net'=>$line->total_ht,
'total_tva'=>$line->total_tva, 'total_vat'=>$line->total_tva,
'total_ttc'=>$line->total_ttc, 'total'=>$line->total_ttc,
'date_start'=>$line->date_start, 'date_start'=>$line->date_start,
'date_end'=>$line->date_end, 'date_end'=>$line->date_end,
'product_ref'=>$line->product_ref, 'product_ref'=>$line->product_ref,
@ -381,18 +378,20 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='')
'ref_client' => $order->ref_client, 'ref_client' => $order->ref_client,
'ref_ext' => $order->ref_ext, 'ref_ext' => $order->ref_ext,
'ref_int' => $order->ref_int, 'ref_int' => $order->ref_int,
'socid' => $order->socid, 'thirdparty_id' => $order->socid,
'statut' => $order->statut, 'status' => $order->statut,
'total_ht' => $order->total_ht, 'total_net' => $order->total_ht,
'total_tva' => $order->total_tva, 'total_vat' => $order->total_tva,
'total_localtax1' => $order->total_localtax1, 'total_localtax1' => $order->total_localtax1,
'total_localtax2' => $order->total_localtax2, 'total_localtax2' => $order->total_localtax2,
'total_ttc' => $order->total_ttc, 'total' => $order->total_ttc,
'fk_project' => $order->fk_project, 'project_id' => $order->fk_project,
'date' => $order->date?dol_print_date($order->date,'dayrfc'):'', 'date' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'',
'date_commande' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'', 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'',
'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'',
'remise' => $order->remise, 'remise' => $order->remise,
'remise_percent' => $order->remise_percent, 'remise_percent' => $order->remise_percent,
@ -403,12 +402,11 @@ function getOrder($authentication,$id='',$ref='',$ref_ext='')
'note' => $order->note, 'note' => $order->note,
'note_public' => $order->note_public, 'note_public' => $order->note_public,
'cond_reglement_id' => $order->cond_reglement_id, 'cond_reglement_id' => $order->cond_reglement_id,
'cond_reglement' => $order->cond_reglement,
'cond_reglement_doc' => $order->cond_reglement_doc,
'cond_reglement_code' => $order->cond_reglement_code, 'cond_reglement_code' => $order->cond_reglement_code,
'cond_reglement' => $order->cond_reglement,
'mode_reglement_id' => $order->mode_reglement_id, 'mode_reglement_id' => $order->mode_reglement_id,
'mode_reglement' => $order->mode_reglement,
'mode_reglement_code' => $order->mode_reglement_code, 'mode_reglement_code' => $order->mode_reglement_code,
'mode_reglement' => $order->mode_reglement,
'date_livraison' => $order->date_livraison, 'date_livraison' => $order->date_livraison,
'fk_delivery_address' => $order->fk_delivery_address, 'fk_delivery_address' => $order->fk_delivery_address,
@ -466,7 +464,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
if ($fuser->societe_id) $socid=$fuser->societe_id; if ($fuser->societe_id) $socid=$fuser->societe_id;
// Check parameters // Check parameters
if (! $error && !$idthirdparty) if (! $error && empty($idthirdparty))
{ {
$error++; $error++;
$errorcode='BAD_PARAMETERS'; $errorlabel='Parameter id is not provided'; $errorcode='BAD_PARAMETERS'; $errorlabel='Parameter id is not provided';
@ -499,7 +497,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
if( $socid && ( $socid != $order->socid) ) if( $socid && ( $socid != $order->socid) )
{ {
$error++; $error++;
$errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.'User does not have permission for this request'; $errorcode='PERMISSION_DENIED'; $errorlabel=$order->socid.' User does not have permission for this request';
} }
if(!$error) if(!$error)
@ -511,6 +509,7 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
{ {
$linesresp[]=array( $linesresp[]=array(
'id'=>$line->rowid, 'id'=>$line->rowid,
'type'=>$line->product_type,
'fk_commande'=>$line->fk_commande, 'fk_commande'=>$line->fk_commande,
'fk_parent_line'=>$line->fk_parent_line, 'fk_parent_line'=>$line->fk_parent_line,
'desc'=>$line->desc, 'desc'=>$line->desc,
@ -520,13 +519,12 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
'tva_tx'=>$line->tva_tx, 'tva_tx'=>$line->tva_tx,
'remise'=>$line->remise, 'remise'=>$line->remise,
'remise_percent'=>$line->remise_percent, 'remise_percent'=>$line->remise_percent,
'fk_product'=>$line->fk_product, 'total_net'=>$line->total_ht,
'product_type'=>$line->product_type, 'total_vat'=>$line->total_tva,
'total_ht'=>$line->total_ht, 'total'=>$line->total_ttc,
'total_tva'=>$line->total_tva,
'total_ttc'=>$line->total_ttc,
'date_start'=>$line->date_start, 'date_start'=>$line->date_start,
'date_end'=>$line->date_end, 'date_end'=>$line->date_end,
'product_id'=>$line->fk_product,
'product_ref'=>$line->product_ref, 'product_ref'=>$line->product_ref,
'product_label'=>$line->product_label, 'product_label'=>$line->product_label,
'product_desc'=>$line->product_desc 'product_desc'=>$line->product_desc
@ -541,17 +539,16 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
'ref_ext' => $order->ref_ext, 'ref_ext' => $order->ref_ext,
'ref_int' => $order->ref_int, 'ref_int' => $order->ref_int,
'socid' => $order->socid, 'socid' => $order->socid,
'statut' => $order->statut, 'status' => $order->statut,
'total_ht' => $order->total_ht, 'total_net' => $order->total_ht,
'total_tva' => $order->total_tva, 'total_vat' => $order->total_tva,
'total_localtax1' => $order->total_localtax1, 'total_localtax1' => $order->total_localtax1,
'total_localtax2' => $order->total_localtax2, 'total_localtax2' => $order->total_localtax2,
'total_ttc' => $order->total_ttc, 'total' => $order->total_ttc,
'fk_project' => $order->fk_project, 'project_id' => $order->fk_project,
'date' => $order->date?dol_print_date($order->date,'dayrfc'):'', 'date' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'',
'date_commande' => $order->date_commande?dol_print_date($order->date_commande,'dayrfc'):'',
'remise' => $order->remise, 'remise' => $order->remise,
'remise_percent' => $order->remise_percent, 'remise_percent' => $order->remise_percent,
@ -570,7 +567,6 @@ function getOrdersForThirdParty($authentication,$idthirdparty)
'mode_reglement_code' => $order->mode_reglement_code, 'mode_reglement_code' => $order->mode_reglement_code,
'date_livraison' => $order->date_livraison, 'date_livraison' => $order->date_livraison,
'fk_delivery_address' => $order->fk_delivery_address,
'demand_reason_id' => $order->demand_reason_id, 'demand_reason_id' => $order->demand_reason_id,
'demand_reason_code' => $order->demand_reason_code, 'demand_reason_code' => $order->demand_reason_code,
@ -618,11 +614,12 @@ function createOrder($authentication,$order)
dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid']); dol_syslog("Function: createOrder login=".$authentication['login']." socid :".$order['socid']);
if ($authentication['entity']) $conf->entity=$authentication['entity'];
// Init and check authentication // Init and check authentication
$objectresp=array(); $objectresp=array();
$errorcode='';$errorlabel=''; $errorcode='';$errorlabel='';
$error=0; $error=0;
if ($authentication['entity']) $conf->entity=$authentication['entity'];
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel); $fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
// Check parameters // Check parameters
@ -631,19 +628,19 @@ function createOrder($authentication,$order)
if (! $error) if (! $error)
{ {
$newobject=new Commande($db); $newobject=new Commande($db);
$newobject->socid=$order['socid']; $newobject->socid=$order['thirdparty_id'];
$newobject->type=$order['type']; $newobject->type=$order['type'];
$newobject->ref_ext=$order['ref_ext']; $newobject->ref_ext=$order['ref_ext'];
$newobject->date=$order['date']; $newobject->date=dol_stringtotime($order['date'],'dayrfc');
$newobject->date_lim_reglement=$order['date_due']; $newobject->date_lim_reglement=dol_stringtotime($order['date_due'],'dayrfc');
$newobject->note=$order['note']; $newobject->note=$order['note'];
$newobject->note_public=$order['note_public']; $newobject->note_public=$order['note_public'];
$newobject->statut=$order['statut']; $newobject->statut=$order['status'];
$newobject->facturee=$order['facturee']; $newobject->facturee=$order['facturee'];
$newobject->fk_project=$order['project_id']; $newobject->fk_project=$order['project_id'];
$newobject->cond_reglement_id=$order['cond_reglement_id']; $newobject->cond_reglement_id=$order['cond_reglement_id'];
$newobject->demand_reason_id=$order['demand_reason_id']; $newobject->demand_reason_id=$order['demand_reason_id'];
$newobject->date_commande=$now; $newobject->date_creation=$now;
// Trick because nusoap does not store data with same structure if there is one or several lines // Trick because nusoap does not store data with same structure if there is one or several lines
$arrayoflines=array(); $arrayoflines=array();
@ -670,17 +667,26 @@ function createOrder($authentication,$order)
$db->begin(); $db->begin();
$object_id=$newobject->create($fuser,0,0); $result=$newobject->create($fuser,0,0);
if ($object_id < 0) if ($result < 0)
{ {
$error++; $error++;
} }
if ($newobject->statut == 1) // We want order validated
{
$result=$newobject->validate($fuser);
if ($result < 0)
{
$error++;
}
}
if (! $error) if (! $error)
{ {
$db->commit(); $db->commit();
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$object_id); $objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref);
} }
else else
{ {
@ -689,6 +695,7 @@ function createOrder($authentication,$order)
$errorcode='KO'; $errorcode='KO';
$errorlabel=$newobject->error; $errorlabel=$newobject->error;
} }
} }
if ($error) if ($error)
@ -784,6 +791,6 @@ function validOrder($authentication,$id='')
// Return the results. // Return the results.
$server->service($HTTP_RAW_POST_DATA); $server->service((isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:''));
?> ?>

View File

@ -111,7 +111,7 @@ $server->wsdl->addComplexType(
'datec' => array('name'=>'datec','type'=>'xsd:dateTime'), 'datec' => array('name'=>'datec','type'=>'xsd:dateTime'),
'datem' => array('name'=>'datem','type'=>'xsd:dateTime'), 'datem' => array('name'=>'datem','type'=>'xsd:dateTime'),
'fk_thirdparty' => array('name'=>'fk_thirdparty','type'=>'xsd:string'), 'fk_thirdparty' => array('name'=>'fk_thirdparty','type'=>'xsd:string'),
'fk_socpeople' => array('name'=>'fk_socpeople','type'=>'xsd:string'), 'fk_contact' => array('name'=>'fk_contact','type'=>'xsd:string'),
'fk_member' => array('name'=>'fk_member','type'=>'xsd:string'), 'fk_member' => array('name'=>'fk_member','type'=>'xsd:string'),
'datelastlogin' => array('name'=>'datelastlogin','type'=>'xsd:dateTime'), 'datelastlogin' => array('name'=>'datelastlogin','type'=>'xsd:dateTime'),
'datepreviouslogin' => array('name'=>'datepreviouslogin','type'=>'xsd:dateTime'), 'datepreviouslogin' => array('name'=>'datepreviouslogin','type'=>'xsd:dateTime'),
@ -132,7 +132,7 @@ $server->wsdl->addComplexType(
'all', 'all',
'', '',
array( array(
'nom' => array('name'=>'nom','type'=>'xsd:string'), 'name' => array('name'=>'name','type'=>'xsd:string'),
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'datec' => array('name'=>'datec','type'=>'xsd:string'), 'datec' => array('name'=>'datec','type'=>'xsd:string'),
'nb' => array('name'=>'nb','type'=>'xsd:string') 'nb' => array('name'=>'nb','type'=>'xsd:string')
@ -264,26 +264,26 @@ $server->register(
); );
$server->register( $server->register(
'CreateUserFromThirdparty', 'createUserFromThirdparty',
// Entry values // Entry values
array('authentication'=>'tns:authentication','thirdpartywithuser'=>'tns:thirdpartywithuser'), array('authentication'=>'tns:authentication','thirdpartywithuser'=>'tns:thirdpartywithuser'),
// Exit values // Exit values
array('result'=>'tns:result','id'=>'xsd:string'), array('result'=>'tns:result','id'=>'xsd:string'),
$ns, $ns,
$ns.'#CreateUserFromThirdparty', $ns.'#createUserFromThirdparty',
$styledoc, $styledoc,
$styleuse, $styleuse,
'WS to create an external user with thirdparty and contact' 'WS to create an external user with thirdparty and contact'
); );
$server->register( $server->register(
'SetUserPassword', 'setUserPassword',
// Entry values // Entry values
array('authentication'=>'tns:authentication','shortuser'=>'tns:shortuser'), array('authentication'=>'tns:authentication','shortuser'=>'tns:shortuser'),
// Exit values // Exit values
array('result'=>'tns:result','id'=>'xsd:string'), array('result'=>'tns:result','id'=>'xsd:string'),
$ns, $ns,
$ns.'#SetUserPassword', $ns.'#setUserPassword',
$styledoc, $styledoc,
$styleuse, $styleuse,
'WS to change password of an user' 'WS to change password of an user'
@ -338,36 +338,36 @@ function getUser($authentication,$id,$ref='',$ref_ext='')
$objectresp = array( $objectresp = array(
'result'=>array('result_code'=>'OK', 'result_label'=>''), 'result'=>array('result_code'=>'OK', 'result_label'=>''),
'user'=>array( 'user'=>array(
'id' => $user->id, 'id' => $user->id,
'lastname' => $user->lastname, 'lastname' => $user->lastname,
'firstname' => $user->firstname, 'firstname' => $user->firstname,
'note' => $user->note, 'note' => $user->note,
'email' => $user->email, 'email' => $user->email,
'signature' => $user->signature, 'signature' => $user->signature,
'office_phone' => $user->office_phone, 'office_phone' => $user->office_phone,
'office_fax' => $user->office_fax, 'office_fax' => $user->office_fax,
'user_mobile' => $user->user_mobile, 'user_mobile' => $user->user_mobile,
'admin' => $user->admin, 'admin' => $user->admin,
'login' => $user->login, 'login' => $user->login,
'entity' => $user->entity, 'entity' => $user->entity,
'pass_indatabase' => $user->pass_indatabase, 'pass_indatabase' => $user->pass_indatabase,
'pass_indatabase_crypted' => $user->pass_indatabase_crypted, 'pass_indatabase_crypted' => $user->pass_indatabase_crypted,
'datec' => dol_print_date($user->datec,'dayhourrfc'), 'datec' => dol_print_date($user->datec,'dayhourrfc'),
'datem' => dol_print_date($user->datem,'dayhourrfc'), 'datem' => dol_print_date($user->datem,'dayhourrfc'),
'fk_thirdparty' => $user->societe_id, 'fk_thirdparty' => $user->societe_id,
'fk_socpeople' => $user->contact_id, 'fk_contact' => $user->contact_id,
'fk_member' => $user->fk_member, 'fk_member' => $user->fk_member,
'webcal_login' => $user->webcal_login, 'webcal_login' => $user->webcal_login,
'phenix_login' => $user->phenix_login, 'phenix_login' => $user->phenix_login,
'phenix_pass' => $user->phenix_pass, 'phenix_pass' => $user->phenix_pass,
'phenix_pass_crypted' => $user->phenix_pass_crypted, 'phenix_pass_crypted' => $user->phenix_pass_crypted,
'datelastlogin' => dol_print_date($user->datelastlogin,'dayhourrfc'), 'datelastlogin' => dol_print_date($user->datelastlogin,'dayhourrfc'),
'datepreviouslogin' => dol_print_date($user->datepreviouslogin,'dayhourrfc'), 'datepreviouslogin' => dol_print_date($user->datepreviouslogin,'dayhourrfc'),
'statut' => $user->statut, 'statut' => $user->statut,
'photo' => $user->photo, 'photo' => $user->photo,
'lang' => $user->lang, 'lang' => $user->lang,
//'rights' => $user->rights, //'rights' => $user->rights,
'canvas' => $user->canvas 'canvas' => $user->canvas
) )
); );
} }
@ -418,7 +418,7 @@ function getListOfGroups($authentication)
if (! $error) if (! $error)
{ {
$sql = "SELECT g.rowid, g.nom, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb"; $sql = "SELECT g.rowid, g.nom as name, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity))) if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
@ -439,7 +439,7 @@ function getListOfGroups($authentication)
while ($i < $num) while ($i < $num)
{ {
$obj=$db->fetch_object($resql); $obj=$db->fetch_object($resql);
$arraygroups[]=array('id'=>$obj->rowid,'nom'=>$obj->nom,'datec'=>$obj->datec,'nb'=>$obj->nb); $arraygroups[]=array('id'=>$obj->rowid,'name'=>$obj->name,'datec'=>$obj->datec,'nb'=>$obj->nb);
$i++; $i++;
} }
} }
@ -477,11 +477,11 @@ function getListOfGroups($authentication)
* @param array $thirdpartywithuser Datas * @param array $thirdpartywithuser Datas
* @return mixed * @return mixed
*/ */
function CreateUserFromThirdparty($authentication,$thirdpartywithuser) function createUserFromThirdparty($authentication,$thirdpartywithuser)
{ {
global $db,$conf,$langs; global $db,$conf,$langs;
dol_syslog("Function: CreateUserFromThirdparty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext); dol_syslog("Function: createUserFromThirdparty login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext);
if ($authentication['entity']) $conf->entity=$authentication['entity']; if ($authentication['entity']) $conf->entity=$authentication['entity'];
@ -518,7 +518,7 @@ function CreateUserFromThirdparty($authentication,$thirdpartywithuser)
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
// If a company or socpeopel is found with the same email we return an error // If a company or contact is found with the same email we return an error
$row = $db->fetch_object($resql); $row = $db->fetch_object($resql);
if ($row) if ($row)
{ {
@ -665,11 +665,11 @@ function CreateUserFromThirdparty($authentication,$thirdpartywithuser)
* @param array $shortuser Array of login/password info * @param array $shortuser Array of login/password info
* @return mixed * @return mixed
*/ */
function SetUserPassword($authentication,$shortuser) { function setUserPassword($authentication,$shortuser) {
global $db,$conf,$langs; global $db,$conf,$langs;
dol_syslog("Function: SetUserPassword login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext); dol_syslog("Function: setUserPassword login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext);
if ($authentication['entity']) $conf->entity=$authentication['entity']; if ($authentication['entity']) $conf->entity=$authentication['entity'];