[*] Classes: calcul position in class when an attribute, an image or a scene is added

This commit is contained in:
rMalie
2011-10-25 15:17:26 +00:00
parent 3c85847608
commit d2f1d99edb
4 changed files with 36 additions and 21 deletions
+8
View File
@@ -94,6 +94,14 @@ class ImageCore extends ObjectModel
return $this->getTranslationsFields(array('legend'));
}
public function add($autodate = true, $null_values = false)
{
if ($this->position <= 0)
$this->position = Image::getHighestPosition($this->id_product) + 1;
return parent::add($autodate, $null_values);
}
public function delete()
{
if (!parent::delete() ||