Skip to content

Commit

Permalink
Fix: uniformize code
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Sep 2, 2012
1 parent 00e0649 commit 0ad137e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/lib/files.lib.php
Expand Up @@ -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);
Expand Down
17 changes: 7 additions & 10 deletions htdocs/ecm/search.php
Expand Up @@ -48,9 +48,9 @@
$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;
Expand All @@ -66,9 +66,9 @@
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);
Expand Down Expand Up @@ -123,10 +123,8 @@
//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);


Expand Down Expand Up @@ -210,7 +208,6 @@
print '<br>';

// End of page
$db->close();

llxFooter();
$db->close();
?>

0 comments on commit 0ad137e

Please sign in to comment.