Newer
Older
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
WHERE vtiger_crmentity.deleted = 0 AND vtiger_activity.activitytype <> 'Emails'
AND vtiger_seactivityrel.crmid = ".$id;
$return_value = GetRelatedList($this_module, $related_module, '', $query, '', '');
if($return_value == null) $return_value = Array();
return $return_value;
}
function get_comments($relatedRecordId = false) {
$current_user = vglobal('current_user');
$moduleName = $this->moduleName;
if($moduleName != 'ModComments') {
return false;
}
$queryGenerator = new EnhancedQueryGenerator($moduleName, $current_user);
if(is_object($this->column_fields)) {
$fields = $this->column_fields->getColumnFieldNames();
} else if(is_array($this->column_fields)) {
$fields = array_keys($this->column_fields);
}
array_push($fields, 'id');
$queryGenerator->setFields($fields);
$query = $queryGenerator->getQuery();
if($relatedRecordId){
$query .= " AND related_to = ".$relatedRecordId." ORDER BY vtiger_crmentity.createdtime DESC";
}
return $query;
}
class TrackableObject implements ArrayAccess, IteratorAggregate {
private $storage;
private $trackingEnabled = true;
function __construct($value = array()) {
$this->storage = $value;
}
function offsetExists($key) {
return isset($this->storage[$key]);
}
function offsetSet($key, $value) {
if($this->tracking && $this->trackingEnabled) {
$olderValue = $this->offsetGet($key);
// decode_html only expects string
$olderValue = is_string($olderValue) ? decode_html($olderValue) : $olderValue ;
//same logic is used in vtEntityDelta to check for delta
if((empty($olderValue) && !empty($value)) || ($olderValue !== $value)) {
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
$this->changed[] = $key;
}
}
$this->storage[$key] = $value;
}
public function offsetUnset($key) {
unset($this->storage[$key]);
}
public function offsetGet($key) {
return isset($this->storage[$key]) ? $this->storage[$key] : null;
}
public function getIterator() {
$iterator = new ArrayObject($this->storage);
return $iterator->getIterator();
}
function getChanged() {
return $this->changed;
}
function startTracking() {
if($this->tracking && $this->trackingEnabled) return;
$this->tracking = true;
$this->changed = array();
}
function restartTracking() {
$this->tracking = true;
$this->startTracking();
}
function pauseTracking() {
$this->tracking = false;
}
function resumeTracking() {
if($this->trackingEnabled)
$this->tracking = true;
}
function getColumnFields() {
return $this->storage;
}
function getColumnFieldNames(){
return array_keys($this->storage);
}