74 $this->Database =
get_package(
'database' ,
'last' , __FILE__ );
75 $this->Link =
get_package(
'link' ,
'last' , __FILE__ );
76 $this->LinkDictionary =
get_package(
'link::link_dictionary' ,
'last' , __FILE__ );
77 $this->Security =
get_package(
'security' ,
'last' , __FILE__ );
78 $this->UserAlgorithms =
get_package(
'user::user_algorithms' ,
'last' , __FILE__ );
116 private function get_entry( $id , $ObjectType , $Name )
122 $Entry = $this->Database->select(
123 $this->NativeTable.
'.field_value' ,
125 $this->NativeTable.
".object_id = $id AND ".$this->NativeTable.
".object_type = $ObjectType AND ".
126 $this->NativeTable.
".field_name LIKE '".$Name.
"' ORDER BY id DESC LIMIT 1"
131 catch( Exception $e )
171 $id = $this->Security->get( $id ,
'integer' );
172 $ObjectType = $this->Security->get( $ObjectType ,
'integer' );;
173 $Name = $this->Security->get( $Name ,
'command' );
175 $Entry = $this->get_entry( $id , $ObjectType , $Name );
177 if( isset( $Entry[ 0 ] ) )
179 return(
get_field( $Entry[ 0 ] ,
'field_value' ) );
184 catch( Exception $e )
230 return( $Value ===
false || ( $Value == $NewValue ?
false :
true ) );
232 catch( Exception $e )
260 $User = $this->UserAlgorithms->get_user();
264 catch( Exception $e )
300 $id = $this->Security->get( $id ,
'integer' );
301 $Record = $this->Security->get( $Record ,
'string' );
302 $ObjectType = $this->LinkDictionary->get_link_type(
'history' , $ObjectType );
305 foreach( $Record as $Name => $Value )
309 $this->Database->insert( $this->NativeTable ,
310 'object_id , object_type , field_name , field_value , creation_date , author' ,
311 "$id , $ObjectType , '$Name' , '$Value' , NOW() , $Author"
314 $this->Database->commit();
318 catch( Exception $e )
354 $id = $this->Security->get( $id ,
'integer' );
355 $ObjectType = $this->LinkDictionary->get_link_type(
'history' , $ObjectType );
360 $this->Database->select(
361 $this->NativeTable.
'.* , umx_user.login AS author_name' ,
362 $this->NativeTable.
' , umx_user' ,
363 $this->NativeTable.
".author = umx_user.id AND ".$this->NativeTable.
".object_id = $id AND ".
364 $this->NativeTable.
".object_type = $ObjectType ORDER BY id ASC"
368 catch( Exception $e )