Look and feel v11
This commit is contained in:
parent
89528e46f1
commit
a92db7db39
@ -75,7 +75,7 @@ class FormOther
|
|||||||
|
|
||||||
$sql = "SELECT rowid, label, fk_user";
|
$sql = "SELECT rowid, label, fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."export_model";
|
$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
|
if (!empty($fk_user)) $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model
|
||||||
$sql .= " ORDER BY rowid";
|
$sql .= " ORDER BY rowid";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -94,10 +94,13 @@ class FormOther
|
|||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
$label = $obj->label;
|
$label = $obj->label;
|
||||||
if (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) {
|
if ($obj->fk_user == 0) {
|
||||||
|
$label .= ' <span class="opacitymedium">('.$langs->trans("Everybody").')</span>';
|
||||||
|
}
|
||||||
|
elseif (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) {
|
||||||
$tmpuser = new User($this->db);
|
$tmpuser = new User($this->db);
|
||||||
$tmpuser->fetch($obj->fk_user);
|
$tmpuser->fetch($obj->fk_user);
|
||||||
$label .= ' <span class="opacitymedium">('.$tmpuser->getFullName($langs).')</span>';
|
$label .= ' <span class="opacitymedium">('.$tmpuser->getFullName($langs).')</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($selected == $obj->rowid)
|
if ($selected == $obj->rowid)
|
||||||
@ -129,14 +132,18 @@ class FormOther
|
|||||||
* @param string $htmlname Nom de la zone select
|
* @param string $htmlname Nom de la zone select
|
||||||
* @param string $type Type des modeles recherches
|
* @param string $type Type des modeles recherches
|
||||||
* @param int $useempty Affiche valeur vide dans liste
|
* @param int $useempty Affiche valeur vide dans liste
|
||||||
|
* @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on)
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0)
|
public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0, $fk_user = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid, label";
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
|
$sql = "SELECT rowid, label, fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."import_model";
|
$sql .= " FROM ".MAIN_DB_PREFIX."import_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";
|
$sql .= " ORDER BY rowid";
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -152,15 +159,26 @@ class FormOther
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$label = $obj->label;
|
||||||
|
if ($obj->fk_user == 0) {
|
||||||
|
$label .= ' <span class="opacitymedium">('.$langs->trans("Everybody").')</span>';
|
||||||
|
}
|
||||||
|
elseif (! empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) {
|
||||||
|
$tmpuser = new User($this->db);
|
||||||
|
$tmpuser->fetch($obj->fk_user);
|
||||||
|
$label .= ' <span class="opacitymedium">('.$tmpuser->getFullName($langs).')</span>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($selected == $obj->rowid)
|
if ($selected == $obj->rowid)
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'" selected>';
|
print '<option value="'.$obj->rowid.'" selected data-html="'.dol_escape_htmltag($label).'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<option value="'.$obj->rowid.'">';
|
print '<option value="'.$obj->rowid.'" data-html="'.dol_escape_htmltag($label).'">';
|
||||||
}
|
}
|
||||||
print $obj->label;
|
print $label;
|
||||||
print '</option>';
|
print '</option>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -862,8 +862,8 @@ if ($step == 4 && $datatoimport)
|
|||||||
print '<input type="hidden" name="separator" value="'.dol_escape_htmltag($separator).'">';
|
print '<input type="hidden" name="separator" value="'.dol_escape_htmltag($separator).'">';
|
||||||
print '<input type="hidden" name="enclosure" value="'.dol_escape_htmltag($enclosure).'">';
|
print '<input type="hidden" name="enclosure" value="'.dol_escape_htmltag($enclosure).'">';
|
||||||
|
|
||||||
print '<div class="marginbottomonly opacitymedium">';
|
print '<div class="marginbottomonly">';
|
||||||
print $langs->trans("SelectImportFields", img_picto('', 'grip_title', '', false, 0, 0, '', '', 0)).' ';
|
print '<span class="opacitymedium">'.$langs->trans("SelectImportFields", img_picto('', 'grip_title', '', false, 0, 0, '', '', 0)).'</span> ';
|
||||||
$htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1);
|
$htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1);
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Select").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user