/** * */ public static function do_create_entity($entity_data) { // First check if the user exists if ($entity_data['edit_mode']) { if (UserPartyAPI::does_party_exist($entity_data['user_name'])) { return EntityAPIUtils::init_error($entity_data, 'Party with the specified user name already exists'); } } $party_role = $entity_data['role']; $display_name = $entity_data['display_name']; $entity_data = EntityAPI::do_create_entity($entity_data); if (isset($entity_data['id'])) { $entity_data['display_name'] = $display_name; PartyProfileAPI::do_create_party_profile($entity_data); BillingAccountAPI::do_create_billing_account($entity_data); PartyRoleAPI::add_role_to_party($entity_data, $party_role); } return $entity_data; }
/** * */ public static function get_list_entity_action_links($page_action, $artifact) { $action_links = array(); if (!UserPartyAPI::is_current_user_portal_admin() && !in_array($artifact, self::$global_entities)) { return $action_links; } $action_links['create_entity_link'] = self::build_link($artifact, self::$link_type_create, self::$link_text_create); return $action_links; }
/** * */ public static function get_order_data_context($entity_data, $additonal_context_data) { $content_user_data = UserPartyAPI::get_party_user($entity_data['order_party']); $data_context = self::get_email_data_context($content_user_data, $additonal_context_data); $data_context['order_discount'] = 0.0; $data_context['order_date'] = date("Y-m-d H:i:s"); $data_context['order_topic'] = $entity_data['name']; $data_context['order_total'] = $entity_data['total']; $data_context['order_no'] = $entity_data['entity_code']; $data_context['order_subtotal'] = $entity_data['total']; $data_context['order_term'] = $entity_data['urgency_txt']; $data_context['order_pages'] = $entity_data['numpages_txt']; $data_context['order_type'] = $entity_data['document_type_txt']; $data_context['order_subject'] = $entity_data['subject_area_txt']; $data_context['order_level'] = $entity_data['academic_level_txt']; return $data_context; }