??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/am1atec.co.uk/wp-content/plugins/latepoint/lib/models/activity_model.php
⬅ Kembali
<?php
class OsActivityModel extends OsModel {
public $id,
$agent_id,
$order_id,
$order_item_id,
$booking_id,
$service_id,
$customer_id,
$coupon_id,
$code,
$description,
$initiated_by,
$initiated_by_id,
$updated_at,
$created_at;
protected $codes;
function __construct( $id = false ) {
parent::__construct();
$this->table_name = LATEPOINT_TABLE_ACTIVITIES;
$this->nice_names = array();
$this->codes = $this->get_codes();
if ( $id ) {
$this->load_by_id( $id );
}
}
protected function get_codes() {
return OsActivitiesHelper::get_codes();
}
public function get_link_to_object( $label = false ) {
$label = ( $label ) ? $label : esc_html__( 'View', 'latepoint' );
$href = '#';
$attrs = '';
switch ( $this->code ) {
case 'agent_updated':
case 'agent_created':
$href = OsRouterHelper::build_link( OsRouterHelper::build_route_name( 'agents', 'edit_form' ), array( 'id' => $this->agent_id ) );
break;
case 'service_updated':
case 'service_created':
$href = OsRouterHelper::build_link( OsRouterHelper::build_route_name( 'services', 'edit_form' ), array( 'id' => $this->service_id ) );
break;
default:
$attrs = 'data-os-params="' . esc_attr( http_build_query( [ 'id' => $this->id ] ) ) . '"
data-os-action="' . esc_attr( OsRouterHelper::build_route_name( 'activities', 'view' ) ) . '"
data-os-lightbox-classes="width-800"
data-os-after-call="latepoint_init_json_view"
data-os-output-target="side-panel"';
break;
}
$link = '<a class="view-activity-link" href="' . esc_url( $href ) . '" ' . $attrs . '>' . $label . '</a>';
$link = apply_filters( 'latepoint_activity_link_to_object', $link, $this, $label );
return $link;
}
public function get_user_link_with_avatar() {
return $this->get_user_link( true );
}
public function get_user_link( $show_avatar = false ) {
$link = '#';
$name = 'n/a';
$attrs = '';
$avatar_url = LATEPOINT_DEFAULT_AVATAR_URL;
switch ( $this->initiated_by ) {
case 'wp_user':
case LATEPOINT_USER_TYPE_ADMIN:
case LATEPOINT_USER_TYPE_CUSTOM:
$link = get_edit_user_link( $this->initiated_by_id );
$userdata = get_userdata( $this->initiated_by_id );
$name = $userdata->display_name;
$avatar_url = get_avatar_url( $this->initiated_by_id, array( 'size' => 200 ) );
break;
case LATEPOINT_USER_TYPE_AGENT:
$agent = new OsAgentModel( $this->initiated_by_id );
$link = OsRouterHelper::build_link( OsRouterHelper::build_route_name( 'agents', 'edit_form' ), array( 'id' => $this->initiated_by_id ) );
$name = $agent->full_name;
$avatar_url = $agent->get_avatar_url();
break;
case LATEPOINT_USER_TYPE_CUSTOMER:
$customer = new OsCustomerModel( $this->initiated_by_id );
$attrs = OsCustomerHelper::quick_customer_btn_html( $this->initiated_by_id );
$name = $customer->full_name;
$avatar_url = $customer->get_avatar_url();
break;
default:
return esc_html( $this->initiated_by ?? 'n/a' );
}
$avatar_url = esc_url( $avatar_url );
$name = esc_html( $name );
$link = esc_url( $link );
$avatar = $show_avatar ? "<span class='ula-avatar' style='background-image: url({$avatar_url})'></span>" : '';
return "<a class='user-link-with-avatar' target='_blank' href='{$link}' {$attrs}>{$avatar}<span class='ula-name'>{$name}</span><span class='latepoint-icon latepoint-icon-external-link'></span></a>";
}
public function get_description() {
if ( $this->code == 'sms_sent' ) {
$this->description = json_decode( $this->description, true );
}
return $this->description;
}
protected function get_nice_created_at( $include_time = true ) {
$format = $include_time ? OsSettingsHelper::get_readable_date_format() . ' ' . OsSettingsHelper::get_readable_time_format() : OsSettingsHelper::get_readable_date_format();
$utc_date = date_create_from_format( LATEPOINT_DATETIME_DB_FORMAT, $this->created_at );
$wp_timezone_date = $utc_date->setTimezone( OsTimeHelper::get_wp_timezone() );
return date_format( $wp_timezone_date, $format );
}
protected function get_name() {
if ( $this->code && isset( $this->codes[ $this->code ] ) ) {
return $this->codes[ $this->code ];
} else {
return $this->code;
}
}
protected function params_to_save( $role = 'admin' ) {
$params_to_save = array(
'id',
'agent_id',
'order_id',
'order_item_id',
'booking_id',
'service_id',
'customer_id',
'coupon_id',
'code',
'description',
'initiated_by',
'initiated_by_id',
);
return $params_to_save;
}
protected function allowed_params( $role = 'admin' ) {
$allowed_params = array(
'id',
'agent_id',
'booking_id',
'order_id',
'order_item_id',
'service_id',
'customer_id',
'coupon_id',
'code',
'description',
'initiated_by',
'initiated_by_id',
);
return $allowed_params;
}
protected function properties_to_validate() {
$validations = array(
'code' => array( 'presence' ),
);
return $validations;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 activity_model.php
php
5.1 KB
2026-03-10 11:15
🐘 agent_meta_model.php
php
190 B
2026-03-10 11:15
🐘 agent_model.php
php
13.5 KB
2026-03-19 14:44
🐘 booking_meta_model.php
php
194 B
2026-03-10 11:15
🐘 booking_model.php
php
43.7 KB
2026-06-24 10:07
🐘 bundle_meta_model.php
php
192 B
2026-03-10 11:15
🐘 bundle_model.php
php
8.9 KB
2026-06-24 10:07
🐘 cart_item_model.php
php
8.4 KB
2026-03-10 11:15
🐘 cart_meta_model.php
php
253 B
2026-03-10 11:15
🐘 cart_model.php
php
16.8 KB
2026-06-15 12:21
🐘 connector_model.php
php
1.1 KB
2026-03-10 11:15
🐘 customer_meta_model.php
php
196 B
2026-03-10 11:15
🐘 customer_model.php
php
15.6 KB
2026-05-14 14:27
🐘 invoice_model.php
php
6 KB
2026-06-15 12:21
🐘 join_bundles_services_model.php
php
1 KB
2026-03-10 11:15
🐘 location_category_model.php
php
4.4 KB
2026-03-10 11:15
🐘 location_model.php
php
6.2 KB
2026-03-10 11:15
🐘 meta_model.php
php
3.8 KB
2026-03-10 11:15
🐘 model.php
php
32.2 KB
2026-03-10 11:15
🐘 off_period_model.php
php
3.1 KB
2026-03-10 11:15
🐘 order_intent_meta_model.php
php
268 B
2026-03-10 11:15
🐘 order_intent_model.php
php
18.8 KB
2026-06-24 10:07
🐘 order_item_model.php
php
8.4 KB
2026-03-10 11:15
🐘 order_meta_model.php
php
255 B
2026-03-10 11:15
🐘 order_model.php
php
18 KB
2026-05-29 11:28
🐘 otp_model.php
php
1.1 KB
2026-03-10 11:15
🐘 payment_request_model.php
php
2.5 KB
2026-03-10 11:15
🐘 process_job_model.php
php
10.3 KB
2026-03-10 11:15
🐘 process_model.php
php
7.8 KB
2026-05-29 11:28
🐘 recurrence_model.php
php
793 B
2026-03-10 11:15
🐘 service_category_model.php
php
3.8 KB
2026-03-10 11:15
🐘 service_meta_model.php
php
194 B
2026-03-10 11:15
🐘 service_model.php
php
18.6 KB
2026-03-10 11:15
🐘 session_model.php
php
898 B
2026-03-10 11:15
🐘 settings_model.php
php
973 B
2026-03-10 11:15
🐘 step_settings_model.php
php
1.1 KB
2026-03-10 11:15
🐘 transaction_intent_model.php
php
11 KB
2026-03-10 11:15
🐘 transaction_model.php
php
6 KB
2026-03-10 11:15
🐘 transaction_refund_model.php
php
1.5 KB
2026-03-10 11:15
🐘 work_period_model.php
php
1.6 KB
2026-03-10 11:15