Ejemplo n.º 1
0
 /** This function should be overridden in each module.  It marks an item as deleted.
  * If it is not overridden, then marking this type of item is not allowed
  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
  * All Rights Reserved..
  * Contributor(s): ______________________________________..
  */
 function mark_deleted($id)
 {
     $date_modified = gmdate('Y-m-d H:i:s');
     if (isset($_SESSION['show_deleted'])) {
         $this->mark_undeleted($id);
     } else {
         // call the custom business logic
         $custom_logic_arguments['id'] = $id;
         $this->call_custom_logic("before_delete", $custom_logic_arguments);
         $query = "UPDATE {$this->table_name} set deleted=1 , date_modified = '{$date_modified}' where id='{$id}'";
         $this->db->query($query, true, "Error marking record deleted: ");
         $this->mark_relationships_deleted($id);
         // Take the item off of the recently viewed lists.
         $tracker = new Tracker();
         $tracker->delete_item_history($id);
         // call the custom business logic
         $this->call_custom_logic("after_delete", $custom_logic_arguments);
     }
 }
Ejemplo n.º 2
0
 /** This function should be overridden in each module.  It marks an item as deleted.
  * If it is not overridden, then marking this type of item is not allowed
  * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
  * All Rights Reserved..
  * Contributor(s): ______________________________________..
  */
 function mark_deleted($id)
 {
     $query = "UPDATE {$this->table_name} set deleted=1 where id=?";
     $this->db->pquery($query, array($id), true, "Error marking record deleted: ");
     $this->mark_relationships_deleted($id);
     // Take the item off of the recently viewed lists.
     $tracker = new Tracker();
     $tracker->delete_item_history($id);
 }