Move api that are admin features into a dedicated /admin api
This commit is contained in:
parent
34bd785785
commit
534c50f46e
@ -19,7 +19,8 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
__PROPALREF__, ...)
|
__PROPALREF__, ...)
|
||||||
* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to standardize naming conventions.
|
* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to standardize naming conventions.
|
||||||
* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others.
|
* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others.
|
||||||
* Some REST API to access the dictionary (country, town, ...) were moved into a common API.
|
* Some REST API to access setup features, like dictionaries (country, town, extrafields, ...) were moved into a
|
||||||
|
common API "/setup".
|
||||||
* Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to
|
* Page bank/index.php and bank/bankentries.php were renamed into bank/list.php and bank/bankentries_list.php to
|
||||||
follow page naming conventions (so default filter/sort order features can also work).
|
follow page naming conventions (so default filter/sort order features can also work).
|
||||||
* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED
|
* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED
|
||||||
|
|||||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
|
|||||||
* @access protected
|
* @access protected
|
||||||
* @class DolibarrApiAccess {@requires user,external}
|
* @class DolibarrApiAccess {@requires user,external}
|
||||||
*/
|
*/
|
||||||
class Dictionary extends DolibarrApi
|
class Setup extends DolibarrApi
|
||||||
{
|
{
|
||||||
private $translations = null;
|
private $translations = null;
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param int $active Payment type is active or not {@min 0} {@max 1}
|
* @param int $active Payment type is active or not {@min 0} {@max 1}
|
||||||
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"
|
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'CHQ')"
|
||||||
*
|
*
|
||||||
* @url GET payment/types
|
* @url GET dictionary/payment_types
|
||||||
*
|
*
|
||||||
* @return array [List of payment types]
|
* @return array [List of payment types]
|
||||||
*
|
*
|
||||||
@ -122,7 +122,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||||
* @return List of countries
|
* @return List of countries
|
||||||
*
|
*
|
||||||
* @url GET countries
|
* @url GET dictionary/countries
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
@ -188,7 +188,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param string $lang Code of the language the name of the
|
* @param string $lang Code of the language the name of the
|
||||||
* country must be translated to
|
* country must be translated to
|
||||||
*
|
*
|
||||||
* @url GET countries/{id}
|
* @url GET dictionary/countries/{id}
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
@ -212,7 +212,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* Clean sensible object datas
|
* Clean sensible object datas
|
||||||
*
|
*
|
||||||
* @param object $object Object to clean
|
* @param object $object Object to clean
|
||||||
* @return array Array of cleaned object properties
|
* @return array Array of cleaned object properties
|
||||||
*/
|
*/
|
||||||
function _cleanObjectDatas($object)
|
function _cleanObjectDatas($object)
|
||||||
{
|
{
|
||||||
@ -263,7 +263,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||||
* @return List of events types
|
* @return List of events types
|
||||||
*
|
*
|
||||||
* @url GET events
|
* @url GET dictionary/event_types
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
@ -402,7 +402,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||||
* @return List of towns
|
* @return List of towns
|
||||||
*
|
*
|
||||||
* @url GET towns
|
* @url GET dictionary/towns
|
||||||
*
|
*
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
@ -463,7 +463,7 @@ class Dictionary extends DolibarrApi
|
|||||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||||
*
|
*
|
||||||
* @url GET payment/terms
|
* @url GET dictionary/payment_terms
|
||||||
*
|
*
|
||||||
* @return array List of payment terms
|
* @return array List of payment terms
|
||||||
*
|
*
|
||||||
@ -30,10 +30,13 @@ class Status
|
|||||||
* Get status (Dolibarr version)
|
* Get status (Dolibarr version)
|
||||||
*/
|
*/
|
||||||
function index() {
|
function index() {
|
||||||
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'success' => array(
|
'success' => array(
|
||||||
'code' => 200,
|
'code' => 200,
|
||||||
'dolibarr_version' => DOL_VERSION
|
'dolibarr_version' => DOL_VERSION,
|
||||||
|
'access_locked' => (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)?'0':$conf->global->MAIN_ONLY_LOGIN_ALLOWED)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2198,10 +2198,7 @@ function getModuleDirForApiClass($module)
|
|||||||
if ($module == 'contracts') {
|
if ($module == 'contracts') {
|
||||||
$moduledirforclass = 'contrat';
|
$moduledirforclass = 'contrat';
|
||||||
}
|
}
|
||||||
elseif (in_array($module, array('login', 'access', 'status', 'documents'))) {
|
elseif (in_array($module, array('login', 'setup', 'access', 'status', 'documents'))) {
|
||||||
$moduledirforclass = 'api';
|
|
||||||
}
|
|
||||||
elseif (preg_match('/^dictionary/', $module)) {
|
|
||||||
$moduledirforclass = 'api';
|
$moduledirforclass = 'api';
|
||||||
}
|
}
|
||||||
elseif ($module == 'contact' || $module == 'contacts' || $module == 'customer' || $module == 'thirdparty' || $module == 'thirdparties') {
|
elseif ($module == 'contact' || $module == 'contacts' || $module == 'customer' || $module == 'thirdparty' || $module == 'thirdparties') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user