Work on website
This commit is contained in:
parent
8282c17803
commit
89baa0b307
@ -6162,22 +6162,16 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$fieldvalues = $this->set_save_query();
|
$now=dol_now();
|
||||||
unset($fieldvalues['rowid']); // We don't update this field, it is the key to define which record to update.
|
|
||||||
|
|
||||||
|
$fieldvalues = $this->set_save_query();
|
||||||
|
if (array_key_exists('date_modification', $fieldvalues) && empty($fieldvalues['date_modification'])) $fieldvalues['date_modification']=$this->db->idate($now);
|
||||||
|
if (array_key_exists('fk_user_modif', $fieldvalues) && ! ($fieldvalues['fk_user_modif'] > 0)) $fieldvalues['fk_user_modif']=$user->id;
|
||||||
|
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into update.
|
||||||
|
|
||||||
|
$keys=array();
|
||||||
foreach ($fieldvalues as $k => $v) {
|
foreach ($fieldvalues as $k => $v) {
|
||||||
if (is_array($key)){
|
$keys[$k] = $k;
|
||||||
$i=array_search($k, $key);
|
|
||||||
if ( $i !== false) {
|
|
||||||
$where[] = $key[$i].'=' . $this->quote($v, $this->fields[$k]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ( $k == $key) {
|
|
||||||
$where[] = $k.'=' .$this->quote($v, $this->fields[$k]);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$tmp[] = $k.'='.$this->quote($v, $this->fields[$k]);
|
$tmp[] = $k.'='.$this->quote($v, $this->fields[$k]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6188,11 +6182,12 @@ abstract class CommonObject
|
|||||||
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; // This is an explicit foreign key field
|
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]=''; // This is an explicit foreign key field
|
||||||
|
|
||||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||||
|
/*
|
||||||
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
|
if ($this->fields[$key]['notnull'] == 1 && empty($values[$key]))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET '.implode( ',', $tmp ).' WHERE rowid='.$this->id ;
|
||||||
|
|||||||
@ -51,7 +51,7 @@ class FormAdmin
|
|||||||
* @param string $htmlname Name of HTML select
|
* @param string $htmlname Name of HTML select
|
||||||
* @param int $showauto Show 'auto' choice
|
* @param int $showauto Show 'auto' choice
|
||||||
* @param array $filter Array of keys to exclude in list
|
* @param array $filter Array of keys to exclude in list
|
||||||
* @param string $showempty 1=Add empty value or string to show
|
* @param string $showempty '1'=Add empty value or string to show
|
||||||
* @param int $showwarning Show a warning if language is not complete
|
* @param int $showwarning Show a warning if language is not complete
|
||||||
* @param int $disabled Disable edit of select
|
* @param int $disabled Disable edit of select
|
||||||
* @param string $morecss Add more css styles
|
* @param string $morecss Add more css styles
|
||||||
|
|||||||
@ -1742,7 +1742,7 @@ if ($action == 'editmeta' || $action == 'create')
|
|||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans('Language');
|
print $langs->trans('Language');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG');
|
print $formadmin->select_language($pagelang?$pagelang:$langs->defaultlang, 'WEBSITE_LANG', 0, null, '1');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user