<?php global $current_user; $customer_id = isset($_GET['id']) ? intval($_GET['id']) : 0; $customer = new \WeDevs\ERP\CRM\Contact($customer_id); ?> <div id="email"> <p class="email-from"> <input type="hidden" v-model="feedData.created_by" name="created_by" value="<?php echo $current_user->ID; ?> "> <label>Form</label> <span class="sep">:</span> <span class="value"><?php echo $current_user->display_name; ?> </span> </p> <p class="email-to"> <input type="hidden" name="user_id" v-model="feedData.user_id" value="<?php echo $customer->id; ?> "> <label>To</label> <span class="sep">:</span> <span class="value"><?php echo $customer->get_full_name(); ?> </span>
/** * Render the customer name column * * @since 1.0 * * @param object $item * * @return string */ function column_name($subscriber_contact) { $contact = new \WeDevs\ERP\CRM\Contact($subscriber_contact->user_id); $actions = array(); $delete_url = ''; $edit_url = ''; $actions['edit'] = sprintf('<a href="%s" data-id="%d" title="%s">%s</a>', $edit_url, $subscriber_contact->user_id, __('Edit this item', 'wp-erp'), __('Edit', 'wp-erp')); $actions['delete'] = sprintf('<a href="%s" class="submitdelete" data-id="%d" title="%s">%s</a>', $delete_url, $subscriber_contact->user_id, __('Delete this item', 'wp-erp'), __('Delete', 'wp-erp')); return sprintf('%4$s <a href="%3$s"><strong>%1$s</strong></a> %2$s', $contact->get_full_name(), $this->row_actions($actions), erp_crm_get_details_url($contact->id, $contact->type), $contact->get_avatar()); }
/** * Set customer social profile info * * @since 1.0 * * @return void */ public function customer_social_profile() { $this->verify_nonce('wp-erp-crm-customer-social-nonce'); // @TODO: check permission unset($_POST['_wp_http_referer']); unset($_POST['_wpnonce']); unset($_POST['action']); if (!$_POST['customer_id']) { $this->send_error(__('No customer found', 'wp-erp')); } $customer_id = (int) $_POST['customer_id']; unset($_POST['customer_id']); $customer = new \WeDevs\ERP\CRM\Contact($customer_id); $customer->update_meta('crm_social_profile', $_POST); $this->send_success(__('Succesfully added social profiles', 'wp-erp')); }
/** * Render the customer name column * * @since 1.0 * * @param object $item * * @return string */ function column_name($customer) { $customer = new \WeDevs\ERP\CRM\Contact(intval($customer->id), $this->contact_type); $actions = array(); $delete_url = ''; $view_url = $customer->get_details_url(); $data_hard = isset($_REQUEST['status']) && $_REQUEST['status'] == 'trash' ? 1 : 0; $delete_text = isset($_REQUEST['status']) && $_REQUEST['status'] == 'trash' ? __('Permanent Delete', 'wp-erp') : __('Delete', 'wp-erp'); $customer_name = $customer->first_name . ' ' . $customer->last_name; $edit_title = $customer->type == 'company' ? __('Edit this Company', 'wp-erp') : __('Edit this customer', 'wp-erp'); $view_title = $customer->type == 'company' ? __('View this Company', 'wp-erp') : __('View this customer', 'wp-erp'); $actions['edit'] = sprintf('<a href="%s" data-id="%d" title="%s">%s</a>', $delete_url, $customer->id, $edit_title, __('Edit', 'wp-erp')); $actions['view'] = sprintf('<a href="%s" title="%s">%s</a>', $view_url, $view_title, __('View', 'wp-erp')); $actions['delete'] = sprintf('<a href="%s" class="submitdelete" data-id="%d" data-hard=%d title="%s">%s</a>', $delete_url, $customer->id, $data_hard, __('Delete this item', 'wp-erp'), $delete_text); if (isset($_REQUEST['status']) && $_REQUEST['status'] == 'trash') { $actions['restore'] = sprintf('<a href="%s" class="restoreCustomer" data-id="%d" title="%s">%s</a>', $delete_url, $customer->id, __('Restore this item', 'wp-erp'), __('Restore', 'wp-erp')); } return sprintf('%4$s <a href="%3$s"><strong>%1$s</strong></a> %2$s', $customer->get_full_name(), $this->row_actions($actions), $customer->get_details_url(), $customer->get_avatar()); }