Commit 4d57868a authored by Anthony.Suerte's avatar Anthony.Suerte

Advertisement Uploader Enhancement [Replace Image Log Message]

parent a6a76898
...@@ -647,42 +647,46 @@ HTMLTABLE; ...@@ -647,42 +647,46 @@ HTMLTABLE;
public function getActivity(){ public function getActivity(){
$type = $this -> getType(); $type = $this -> getType();
$details = array(); $details = array();
$fileDetails = $this -> getFileDetailsByID($this -> adID);
if($type == TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE){ if($type == TYPE_IMAGE_MANAGER_UPLOAD_COMPLETE){
$message = 'Uploaded ['.basename($_FILES[PARAM_IMG1][PARAM_NAME]).']'; $message = "Uploaded {$this -> saveName} [{$this -> adsID}]";
}elseif($type == TYPE_DELETE){ }elseif($type == TYPE_DELETE && $this -> isLoopData($fileDetails)){
$message = 'Deleted ['.$this -> getFileDetailsByID($this -> adID, 'file_name').']'; $message = "Deleted [{$this -> getColumnData($fileDetails, 'ads_id')}]";
}elseif($type == TYPE_UPDATE){ }elseif($type == TYPE_UPDATE && $this -> isLoopData($fileDetails)){
$origID = $this -> getFileDetailsByID($this -> adID, 'ads_id'); $origID = $this -> getColumnData($fileDetails, 'ads_id');
$newID = $this -> adName; $newID = $this -> adName;
$origLink = $this -> getFileDetailsByID($this -> adID, 'redirect_link'); $origLink = $this -> getColumnData($fileDetails, 'redirect_link');
$newLink = $this -> link; $newLink = $this -> link;
$origLang = $this -> getFileDetailsByID($this -> adID, 'language'); $origLang = $this -> getColumnData($fileDetails, 'language');
$newLang = $this -> language; $newLang = $this -> language;
$origLoc = $this -> getFileDetailsByID($this -> adID, 'ads_location'); $origLoc = $this -> getColumnData($fileDetails, 'ads_location');
$newLoc = $this -> location; $newLoc = $this -> location;
if($origID != $newID){ if($origID != $newID){
$details[] = 'Edited ID of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origID.'] to ['.$newID.']'; $details[] = "Edited ID of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origID}] to [{$newID}]";
} }
if($origLink != $newLink){ if($origLink != $newLink){
$details[] = 'Edited Link of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLink.'] to ['.$newLink.']'; $details[] = "Edited Link of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLink}] to [{$newLink}]";
} }
if($origLang != $newLang){ if($origLang != $newLang){
$details[] = 'Edited Language of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLang.'] to ['.$newLang.']'; $details[] = "Edited Language of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLang}] to [{$newLang}]";
} }
if($origLoc != $newLoc){ if($origLoc != $newLoc){
$details[] = 'Edited Location of '.$this -> getFileDetailsByID($this -> adID, 'file_name').' from ['.$origLoc.'] to ['.$newLoc.']'; $details[] = "Edited Location of {$this -> getColumnData($fileDetails, 'ads_id')} from [{$origLoc}] to [{$newLoc}]";
}
if($this -> isUpload(PARAM_IMG1)){
$details[] = "Uploaded New Image of {$this -> getColumnData($fileDetails, 'ads_id')}";
} }
if($details != NULL){ if($details != NULL){
$message = implode(', <br/>', $details); $message = implode(", <br/>", $details);
}else{ }else{
$message = 'Saved without any changes'; $message = "Saved without any changes";
} }
} }
...@@ -698,10 +702,7 @@ HTMLTABLE; ...@@ -698,10 +702,7 @@ HTMLTABLE;
return $rtn; return $rtn;
} }
public function getFileDetailsByID($id, $column){ public function getFileDetailsByID($id){
$row = $this -> accessSelect('SELECT_AD_DETAILS', array($id)); return $this -> getRowData($this -> accessSelect('SELECT_AD_DETAILS', array($id)));
$details = $this -> getColumnData($row[0], $column);
return $details;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment