You are here

function support_client_update in Support Ticketing System 6

Update a client

Parameters

$client: Client object.

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

File

./support.module, line 3704
support.module

Code

function support_client_update($client) {
  drupal_alter('support_client_update', $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, 'clid');
  if ($rc == SAVED_UPDATED) {
    drupal_set_message(t('Client %client updated successfully.', array(
      '%client' => $client->name,
    )));
    module_invoke_all('support_client_updated', $client);
  }
  else {
    drupal_set_message(t('Client %client update failed.', array(
      '%client' => $client->name,
    )), 'error');
  }
}