Skip to content

Commit

Permalink
Add missing fk_user in import list
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Dec 23, 2019
1 parent a076c3c commit c6ed605
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions htdocs/core/class/html.formother.class.php
Expand Up @@ -71,9 +71,11 @@ public function __construct($db)
public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null)
{
// phpcs:enable
$sql = "SELECT rowid, label";
global $conf;

$sql = "SELECT rowid, label, fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."export_model";
$sql .= " WHERE type = '".$type."'";
$sql .= " WHERE type = '".$this->db->escape($type)."'";
if (!empty($fk_user)) $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model
$sql .= " ORDER BY rowid";
$result = $this->db->query($sql);
Expand All @@ -99,6 +101,11 @@ public function select_export_model($selected = '', $htmlname = 'exportmodelid',
print '<option value="'.$obj->rowid.'">';
}
print $obj->label;
if (! empty($conf->global->EXPORTS_SHARE_MODELS) && $fk_user == $obj->fk_user) {
$tmpuser = new User($this->db);
$tmpuser->fetch($fk_user);
print ' ('.$tmpuser->getFullName().')';
}
print '</option>';
$i++;
}
Expand Down

0 comments on commit c6ed605

Please sign in to comment.