You are here

function support_client_create in Support Ticketing System 6

Create a client

Parameters

$client: Client object.

1 call to support_client_create()
support_admin_client_submit in ./support.admin.inc
Add/update client information.

File

./support.module, line 3729
support.module

Code

function support_client_create($client) {
  drupal_alter('support_client_create', $client);
  if (isset($client->name)) {
    $client->name = check_plain($client->name);
  }
  if (empty($client->name)) {
    drupal_set_message(t('Valid client name required.'), 'error');
    return -1;
  }
  $rc = drupal_write_record('support_client', $client);
  if ($rc == SAVED_NEW) {
    drupal_set_message(t('Client %client created successfully.', array(
      '%client' => $client->name,
    )));
    module_invoke_all('support_client_created', $client);
  }
  else {
    drupal_set_message(t('Client %client creation failed.', array(
      '%client' => $client->name,
    )), 'error');
  }
}