forked from Wavyzz/dolibarr
Fix PhanPluginRedundantAssignment
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -81,11 +82,11 @@ $server->wsdl->addComplexType(
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'dolibarrkey' => array('name'=>'dolibarrkey', 'type'=>'xsd:string'),
|
||||
'sourceapplication' => array('name'=>'sourceapplication', 'type'=>'xsd:string'),
|
||||
'login' => array('name'=>'login', 'type'=>'xsd:string'),
|
||||
'password' => array('name'=>'password', 'type'=>'xsd:string'),
|
||||
'entity' => array('name'=>'entity', 'type'=>'xsd:string'),
|
||||
'dolibarrkey' => array('name' => 'dolibarrkey', 'type' => 'xsd:string'),
|
||||
'sourceapplication' => array('name' => 'sourceapplication', 'type' => 'xsd:string'),
|
||||
'login' => array('name' => 'login', 'type' => 'xsd:string'),
|
||||
'password' => array('name' => 'password', 'type' => 'xsd:string'),
|
||||
'entity' => array('name' => 'entity', 'type' => 'xsd:string'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -97,8 +98,8 @@ $server->wsdl->addComplexType(
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'result_code' => array('name'=>'result_code', 'type'=>'xsd:string'),
|
||||
'result_label' => array('name'=>'result_label', 'type'=>'xsd:string'),
|
||||
'result_code' => array('name' => 'result_code', 'type' => 'xsd:string'),
|
||||
'result_label' => array('name' => 'result_label', 'type' => 'xsd:string'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -110,34 +111,34 @@ $server->wsdl->addComplexType(
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'element' => array('name'=>'element', 'type'=>'xsd:string'),
|
||||
'id' => array('name'=>'id', 'type'=>'xsd:string'),
|
||||
'lastname' => array('name'=>'lastname', 'type'=>'xsd:string'),
|
||||
'firstname' => array('name'=>'firstname', 'type'=>'xsd:string'),
|
||||
'note' => array('name'=>'note', 'type'=>'xsd:string'),
|
||||
'email' => array('name'=>'email', 'type'=>'xsd:string'),
|
||||
'signature' => array('name'=>'signature', 'type'=>'xsd:string'),
|
||||
'office_phone' => array('name'=>'office_phone', 'type'=>'xsd:string'),
|
||||
'office_fax' => array('name'=>'office_fax', 'type'=>'xsd:string'),
|
||||
'user_mobile' => array('name'=>'user_mobile', 'type'=>'xsd:string'),
|
||||
'admin' => array('name'=>'admin', 'type'=>'xsd:string'),
|
||||
'login' => array('name'=>'login', 'type'=>'xsd:string'),
|
||||
'entity' => array('name'=>'entity', 'type'=>'xsd:string'),
|
||||
'pass_indatabase' => array('name'=>'pass_indatabase', 'type'=>'xsd:string'),
|
||||
'pass_indatabase_crypted' => array('name'=>'pass_indatabase_crypted', 'type'=>'xsd:string'),
|
||||
'datec' => array('name'=>'datec', 'type'=>'xsd:dateTime'),
|
||||
'datem' => array('name'=>'datem', 'type'=>'xsd:dateTime'),
|
||||
'fk_thirdparty' => array('name'=>'fk_thirdparty', 'type'=>'xsd:string'),
|
||||
'fk_contact' => array('name'=>'fk_contact', 'type'=>'xsd:string'),
|
||||
'fk_member' => array('name'=>'fk_member', 'type'=>'xsd:string'),
|
||||
'datelastlogin' => array('name'=>'datelastlogin', 'type'=>'xsd:dateTime'),
|
||||
'datepreviouslogin' => array('name'=>'datepreviouslogin', 'type'=>'xsd:dateTime'),
|
||||
'statut' => array('name'=>'statut', 'type'=>'xsd:string'),
|
||||
'photo' => array('name'=>'photo', 'type'=>'xsd:string'),
|
||||
'lang' => array('name'=>'lang', 'type'=>'xsd:string'),
|
||||
'entrepots' => array('name'=>'entrepots', 'type'=>'xsd:string'),
|
||||
'element' => array('name' => 'element', 'type' => 'xsd:string'),
|
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'),
|
||||
'lastname' => array('name' => 'lastname', 'type' => 'xsd:string'),
|
||||
'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
|
||||
'note' => array('name' => 'note', 'type' => 'xsd:string'),
|
||||
'email' => array('name' => 'email', 'type' => 'xsd:string'),
|
||||
'signature' => array('name' => 'signature', 'type' => 'xsd:string'),
|
||||
'office_phone' => array('name' => 'office_phone', 'type' => 'xsd:string'),
|
||||
'office_fax' => array('name' => 'office_fax', 'type' => 'xsd:string'),
|
||||
'user_mobile' => array('name' => 'user_mobile', 'type' => 'xsd:string'),
|
||||
'admin' => array('name' => 'admin', 'type' => 'xsd:string'),
|
||||
'login' => array('name' => 'login', 'type' => 'xsd:string'),
|
||||
'entity' => array('name' => 'entity', 'type' => 'xsd:string'),
|
||||
'pass_indatabase' => array('name' => 'pass_indatabase', 'type' => 'xsd:string'),
|
||||
'pass_indatabase_crypted' => array('name' => 'pass_indatabase_crypted', 'type' => 'xsd:string'),
|
||||
'datec' => array('name' => 'datec', 'type' => 'xsd:dateTime'),
|
||||
'datem' => array('name' => 'datem', 'type' => 'xsd:dateTime'),
|
||||
'fk_thirdparty' => array('name' => 'fk_thirdparty', 'type' => 'xsd:string'),
|
||||
'fk_contact' => array('name' => 'fk_contact', 'type' => 'xsd:string'),
|
||||
'fk_member' => array('name' => 'fk_member', 'type' => 'xsd:string'),
|
||||
'datelastlogin' => array('name' => 'datelastlogin', 'type' => 'xsd:dateTime'),
|
||||
'datepreviouslogin' => array('name' => 'datepreviouslogin', 'type' => 'xsd:dateTime'),
|
||||
'statut' => array('name' => 'statut', 'type' => 'xsd:string'),
|
||||
'photo' => array('name' => 'photo', 'type' => 'xsd:string'),
|
||||
'lang' => array('name' => 'lang', 'type' => 'xsd:string'),
|
||||
'entrepots' => array('name' => 'entrepots', 'type' => 'xsd:string'),
|
||||
//'rights' => array('name'=>'rights','type'=>'xsd:string'),
|
||||
'canvas' => array('name'=>'canvas', 'type'=>'xsd:string')
|
||||
'canvas' => array('name' => 'canvas', 'type' => 'xsd:string')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -149,10 +150,10 @@ $server->wsdl->addComplexType(
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'name' => array('name'=>'name', 'type'=>'xsd:string'),
|
||||
'id' => array('name'=>'id', 'type'=>'xsd:string'),
|
||||
'datec' => array('name'=>'datec', 'type'=>'xsd:string'),
|
||||
'nb' => array('name'=>'nb', 'type'=>'xsd:string')
|
||||
'name' => array('name' => 'name', 'type' => 'xsd:string'),
|
||||
'id' => array('name' => 'id', 'type' => 'xsd:string'),
|
||||
'datec' => array('name' => 'datec', 'type' => 'xsd:string'),
|
||||
'nb' => array('name' => 'nb', 'type' => 'xsd:string')
|
||||
)
|
||||
);
|
||||
|
||||
@@ -164,42 +165,42 @@ $server->wsdl->addComplexType(
|
||||
'SOAP-ENC:Array',
|
||||
array(),
|
||||
array(
|
||||
array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:group[]')
|
||||
array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:group[]')
|
||||
),
|
||||
'tns:group'
|
||||
);
|
||||
|
||||
$thirdpartywithuser_fields = array(
|
||||
// For thirdparty and contact
|
||||
'name' => array('name'=>'name', 'type'=>'xsd:string'),
|
||||
'firstname' => array('name'=>'firstname', 'type'=>'xsd:string'),
|
||||
'name_thirdparty' => array('name'=>'name_thirdparty', 'type'=>'xsd:string'),
|
||||
'ref_ext' => array('name'=>'ref_ext', 'type'=>'xsd:string'),
|
||||
'client' => array('name'=>'client', 'type'=>'xsd:string'),
|
||||
'fournisseur' => array('name'=>'fournisseur', 'type'=>'xsd:string'),
|
||||
'address' => array('name'=>'address', 'type'=>'xsd:string'),
|
||||
'zip' => array('name'=>'zip', 'type'=>'xsd:string'),
|
||||
'town' => array('name'=>'town', 'type'=>'xsd:string'),
|
||||
'country_id' => array('name'=>'country_id', 'type'=>'xsd:string'),
|
||||
'country_code' => array('name'=>'country_code', 'type'=>'xsd:string'),
|
||||
'phone' => array('name'=>'phone', 'type'=>'xsd:string'),
|
||||
'phone_mobile' => array('name'=>'phone_mobile', 'type'=>'xsd:string'),
|
||||
'fax' => array('name'=>'fax', 'type'=>'xsd:string'),
|
||||
'email' => array('name'=>'email', 'type'=>'xsd:string'),
|
||||
'url' => array('name'=>'url', 'type'=>'xsd:string'),
|
||||
'profid1' => array('name'=>'profid1', 'type'=>'xsd:string'),
|
||||
'profid2' => array('name'=>'profid2', 'type'=>'xsd:string'),
|
||||
'profid3' => array('name'=>'profid3', 'type'=>'xsd:string'),
|
||||
'profid4' => array('name'=>'profid4', 'type'=>'xsd:string'),
|
||||
'profid5' => array('name'=>'profid5', 'type'=>'xsd:string'),
|
||||
'profid6' => array('name'=>'profid6', 'type'=>'xsd:string'),
|
||||
'capital' => array('name'=>'capital', 'type'=>'xsd:string'),
|
||||
'tva_assuj' => array('name'=>'tva_assuj', 'type'=>'xsd:string'),
|
||||
'tva_intra' => array('name'=>'tva_intra', 'type'=>'xsd:string'),
|
||||
'name' => array('name' => 'name', 'type' => 'xsd:string'),
|
||||
'firstname' => array('name' => 'firstname', 'type' => 'xsd:string'),
|
||||
'name_thirdparty' => array('name' => 'name_thirdparty', 'type' => 'xsd:string'),
|
||||
'ref_ext' => array('name' => 'ref_ext', 'type' => 'xsd:string'),
|
||||
'client' => array('name' => 'client', 'type' => 'xsd:string'),
|
||||
'fournisseur' => array('name' => 'fournisseur', 'type' => 'xsd:string'),
|
||||
'address' => array('name' => 'address', 'type' => 'xsd:string'),
|
||||
'zip' => array('name' => 'zip', 'type' => 'xsd:string'),
|
||||
'town' => array('name' => 'town', 'type' => 'xsd:string'),
|
||||
'country_id' => array('name' => 'country_id', 'type' => 'xsd:string'),
|
||||
'country_code' => array('name' => 'country_code', 'type' => 'xsd:string'),
|
||||
'phone' => array('name' => 'phone', 'type' => 'xsd:string'),
|
||||
'phone_mobile' => array('name' => 'phone_mobile', 'type' => 'xsd:string'),
|
||||
'fax' => array('name' => 'fax', 'type' => 'xsd:string'),
|
||||
'email' => array('name' => 'email', 'type' => 'xsd:string'),
|
||||
'url' => array('name' => 'url', 'type' => 'xsd:string'),
|
||||
'profid1' => array('name' => 'profid1', 'type' => 'xsd:string'),
|
||||
'profid2' => array('name' => 'profid2', 'type' => 'xsd:string'),
|
||||
'profid3' => array('name' => 'profid3', 'type' => 'xsd:string'),
|
||||
'profid4' => array('name' => 'profid4', 'type' => 'xsd:string'),
|
||||
'profid5' => array('name' => 'profid5', 'type' => 'xsd:string'),
|
||||
'profid6' => array('name' => 'profid6', 'type' => 'xsd:string'),
|
||||
'capital' => array('name' => 'capital', 'type' => 'xsd:string'),
|
||||
'tva_assuj' => array('name' => 'tva_assuj', 'type' => 'xsd:string'),
|
||||
'tva_intra' => array('name' => 'tva_intra', 'type' => 'xsd:string'),
|
||||
// For user
|
||||
'login' => array('name'=>'login', 'type'=>'xsd:string'),
|
||||
'password' => array('name'=>'password', 'type'=>'xsd:string'),
|
||||
'group_id' => array('name'=>'group_id', 'type'=>'xsd:string')
|
||||
'login' => array('name' => 'login', 'type' => 'xsd:string'),
|
||||
'password' => array('name' => 'password', 'type' => 'xsd:string'),
|
||||
'group_id' => array('name' => 'group_id', 'type' => 'xsd:string')
|
||||
);
|
||||
|
||||
$elementtype = 'socpeople';
|
||||
@@ -221,7 +222,7 @@ if (isset($extrafields->attributes[$elementtype]['label']) && is_array($extrafie
|
||||
$type = 'xsd:string';
|
||||
}
|
||||
|
||||
$extrafield_array['contact_options_'.$key] = array('name'=>'contact_options_'.$key, 'type'=>$type);
|
||||
$extrafield_array['contact_options_'.$key] = array('name' => 'contact_options_'.$key, 'type' => $type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,9 +248,9 @@ $server->wsdl->addComplexType(
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'login' => array('name'=>'login', 'type'=>'xsd:string'),
|
||||
'password' => array('name'=>'password', 'type'=>'xsd:string'),
|
||||
'entity' => array('name'=>'entity', 'type'=>'xsd:string'),
|
||||
'login' => array('name' => 'login', 'type' => 'xsd:string'),
|
||||
'password' => array('name' => 'password', 'type' => 'xsd:string'),
|
||||
'entity' => array('name' => 'entity', 'type' => 'xsd:string'),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -267,9 +268,9 @@ $styleuse = 'encoded'; // encoded/literal/literal wrapped
|
||||
$server->register(
|
||||
'getUser',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication', 'id'=>'xsd:string', 'ref'=>'xsd:string', 'ref_ext'=>'xsd:string'),
|
||||
array('authentication' => 'tns:authentication', 'id' => 'xsd:string', 'ref' => 'xsd:string', 'ref_ext' => 'xsd:string'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result', 'user'=>'tns:user'),
|
||||
array('result' => 'tns:result', 'user' => 'tns:user'),
|
||||
$ns,
|
||||
$ns.'#getUser',
|
||||
$styledoc,
|
||||
@@ -280,9 +281,9 @@ $server->register(
|
||||
$server->register(
|
||||
'getListOfGroups',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication'),
|
||||
array('authentication' => 'tns:authentication'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result', 'groups'=>'tns:GroupsArray'),
|
||||
array('result' => 'tns:result', 'groups' => 'tns:GroupsArray'),
|
||||
$ns,
|
||||
$ns.'#getListOfGroups',
|
||||
$styledoc,
|
||||
@@ -293,9 +294,9 @@ $server->register(
|
||||
$server->register(
|
||||
'createUserFromThirdparty',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication', 'thirdpartywithuser'=>'tns:thirdpartywithuser'),
|
||||
array('authentication' => 'tns:authentication', 'thirdpartywithuser' => 'tns:thirdpartywithuser'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result', 'id'=>'xsd:string'),
|
||||
array('result' => 'tns:result', 'id' => 'xsd:string'),
|
||||
$ns,
|
||||
$ns.'#createUserFromThirdparty',
|
||||
$styledoc,
|
||||
@@ -306,9 +307,9 @@ $server->register(
|
||||
$server->register(
|
||||
'setUserPassword',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication', 'shortuser'=>'tns:shortuser'),
|
||||
array('authentication' => 'tns:authentication', 'shortuser' => 'tns:shortuser'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result', 'id'=>'xsd:string'),
|
||||
array('result' => 'tns:result', 'id' => 'xsd:string'),
|
||||
$ns,
|
||||
$ns.'#setUserPassword',
|
||||
$styledoc,
|
||||
@@ -363,8 +364,8 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '')
|
||||
if ($result > 0) {
|
||||
// Create
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
||||
'user'=>array(
|
||||
'result' => array('result_code' => 'OK', 'result_label' => ''),
|
||||
'user' => array(
|
||||
'id' => $user->id,
|
||||
'lastname' => $user->lastname,
|
||||
'firstname' => $user->firstname,
|
||||
@@ -406,7 +407,7 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '')
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||
$objectresp = array('result' => array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||
}
|
||||
|
||||
return $objectresp;
|
||||
@@ -454,7 +455,7 @@ function getListOfGroups($authentication)
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$arraygroups[] = array('id'=>$obj->rowid, 'name'=>$obj->name, 'datec'=>$obj->datec, 'nb'=>$obj->nb);
|
||||
$arraygroups[] = array('id' => $obj->rowid, 'name' => $obj->name, 'datec' => $obj->datec, 'nb' => $obj->nb);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@@ -466,13 +467,13 @@ function getListOfGroups($authentication)
|
||||
|
||||
if ($error) {
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel),
|
||||
'groups'=>$arraygroups
|
||||
'result' => array('result_code' => $errorcode, 'result_label' => $errorlabel),
|
||||
'groups' => $arraygroups
|
||||
);
|
||||
} else {
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code' => 'OK', 'result_label' => ''),
|
||||
'groups'=>$arraygroups
|
||||
'result' => array('result_code' => 'OK', 'result_label' => ''),
|
||||
'groups' => $arraygroups
|
||||
);
|
||||
}
|
||||
|
||||
@@ -648,8 +649,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
$objectresp = array('result'=>array('result_code'=>'OK', 'result_label'=>'SUCCESS'), 'id'=>$socid_return);
|
||||
$error = 0;
|
||||
$objectresp = array('result' => array('result_code' => 'OK', 'result_label' => 'SUCCESS'), 'id' => $socid_return);
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
@@ -672,7 +672,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)
|
||||
'result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ function setUserPassword($authentication, $shortuser)
|
||||
$errorlabel = 'Error when changing password';
|
||||
} else {
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code' => 'OK', 'result_label' => ''),
|
||||
'result' => array('result_code' => 'OK', 'result_label' => ''),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -746,7 +746,7 @@ function setUserPassword($authentication, $shortuser)
|
||||
|
||||
if ($error) {
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)
|
||||
'result' => array('result_code' => $errorcode, 'result_label' => $errorlabel)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user