Update list.php
This commit is contained in:
parent
a6d8f943df
commit
1b9039af36
@ -22,15 +22,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// Change this following line to use the correct relative path (../, ../../, etc)
|
require '../main.inc.php';
|
||||||
$res=0;
|
require_once DOL_DOCUMENT_ROOT.'/resource/class/resource.class.php';
|
||||||
$res=@include("../main.inc.php"); // For root directory
|
|
||||||
if (! $res) $res=@include("../../main.inc.php"); // For "custom" directory
|
|
||||||
if (! $res) die("Include of main fails");
|
|
||||||
|
|
||||||
require 'class/resource.class.php';
|
// Load translations files requiredby by page
|
||||||
|
|
||||||
// Load traductions files requiredby by page
|
|
||||||
$langs->load("resource");
|
$langs->load("resource");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
@ -52,7 +47,7 @@ $object = new Resource($db);
|
|||||||
|
|
||||||
$hookmanager->initHooks(array('resource_list'));
|
$hookmanager->initHooks(array('resource_list'));
|
||||||
|
|
||||||
if (empty($sortorder)) $sortorder="DESC";
|
if (empty($sortorder)) $sortorder="ASC";
|
||||||
if (empty($sortfield)) $sortfield="t.rowid";
|
if (empty($sortfield)) $sortfield="t.rowid";
|
||||||
if (empty($arch)) $arch = 0;
|
if (empty($arch)) $arch = 0;
|
||||||
|
|
||||||
@ -89,8 +84,6 @@ llxHeader('',$pagetitle,'');
|
|||||||
|
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
print_fiche_titre($pagetitle,'','title_generic');
|
|
||||||
|
|
||||||
// Confirmation suppression resource line
|
// Confirmation suppression resource line
|
||||||
if ($action == 'delete_resource')
|
if ($action == 'delete_resource')
|
||||||
{
|
{
|
||||||
@ -102,6 +95,8 @@ $ret = $object->fetch_all($sortorder, $sortfield, $limit, $offset);
|
|||||||
if($ret == -1) {
|
if($ret == -1) {
|
||||||
dol_print_error($db,$object->error);
|
dol_print_error($db,$object->error);
|
||||||
exit;
|
exit;
|
||||||
|
} else {
|
||||||
|
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $object->num_all,'title_generic.png');
|
||||||
}
|
}
|
||||||
if(!$ret) {
|
if(!$ret) {
|
||||||
print '<div class="warning">'.$langs->trans('NoResourceInDatabase').'</div>';
|
print '<div class="warning">'.$langs->trans('NoResourceInDatabase').'</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user