Fix: uniformize code

This commit is contained in:
Regis Houssin 2012-08-09 07:47:41 +02:00
parent 00e0649cde
commit 0ad137e734
2 changed files with 9 additions and 12 deletions

View File

@ -139,12 +139,12 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
closedir($dir);
// Obtain a list of columns
if ($sortcriteria)
if (! empty($sortcriteria))
{
$myarray=array();
foreach ($file_list as $key => $row)
{
$myarray[$key] = $row[$sortcriteria];
$myarray[$key] = (isset($row[$sortcriteria])?$row[$sortcriteria]:'');
}
// Sort the data
if ($sortorder) array_multisort($myarray, $sortorder, $file_list);

View File

@ -48,9 +48,9 @@ $result = restrictedArea($user, 'ecm','');
$user->getrights('ecm');
// Get parameters
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
$action = isset($_GET["action"])?$_GET["action"]:$_POST['action'];
$section=isset($_GET["section"])?$_GET["section"]:$_POST['section'];
$socid = GETPOST('socid','int');
$action = GETPOST('action','alpha');
$section=GETPOST('section');
if (! $section) $section=0;
$upload_dir = $conf->ecm->dir_output.'/'.$section;
@ -66,9 +66,9 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="label";
$ecmdir = new EcmDirectory($db);
if (! empty($_REQUEST["section"]))
if (! empty($section))
{
$result=$ecmdir->fetch($_REQUEST["section"]);
$result=$ecmdir->fetch($section);
if (! $result > 0)
{
dol_print_error($db,$ecmdir->error);
@ -123,10 +123,8 @@ print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("Search"));
//print "<br>\n";
print $langs->trans("FeatureNotYetAvailable").'.<br><br>';
if ($mesg) { print $mesg."<br>"; }
// Tool bar
$head = ecm_prepare_head_fm($fac);
$head = ecm_prepare_head_fm($ecmdir);
//dol_fiche_head($head, 'search_form', '', 1);
@ -210,7 +208,6 @@ print '</table>';
print '<br>';
// End of page
$db->close();
llxFooter();
$db->close();
?>