Merge pull request #21953 from dolibit-ut/patch-464
Update document.php
This commit is contained in:
commit
1ccd9efdeb
@ -26,30 +26,36 @@
|
|||||||
* \ingroup societe
|
* \ingroup societe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Load Dolibarr environment
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("companies", "other"));
|
$langs->loadLangs(array("companies", "other"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
|
||||||
$confirm = GETPOST('confirm');
|
|
||||||
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
|
||||||
$ref = GETPOST('ref', 'alpha');
|
|
||||||
|
|
||||||
// Get parameters
|
// Get parameters
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$action = GETPOST('action', 'aZ09');
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$confirm = GETPOST('confirm');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
|
||||||
if (empty($page) || $page == -1) {
|
if (empty($page) || $page == -1) {
|
||||||
$page = 0;
|
$page = 0;
|
||||||
} // If $page is not defined, or '' or -1
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
|
||||||
$pageprev = $page - 1;
|
$offset = $limit * $page;
|
||||||
$pagenext = $page + 1;
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) {
|
if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) {
|
||||||
$sortfield = $conf->global->MAIN_DOC_SORT_FIELD;
|
$sortfield = $conf->global->MAIN_DOC_SORT_FIELD;
|
||||||
@ -65,6 +71,7 @@ if (!$sortfield) {
|
|||||||
$sortfield = "position_name";
|
$sortfield = "position_name";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize objects
|
||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user