Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
More tweaking to the strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmiddle committed Oct 9, 2011
1 parent 6cf52d0 commit 94ca868
Showing 1 changed file with 36 additions and 27 deletions.
63 changes: 36 additions & 27 deletions api/cron_convert_auditlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ function run() {
$ticket_id = intval($row['ticket_id']);
$ticket = DAO_Ticket::get($ticket_id);
$worker_id = intval($row['worker_id']);
$worker = DAO_Worker::get($worker_id);
$worker_name = ((!empty($worker) && $worker instanceof Model_Worker) ? $worker->getName() : 'unknown');
$change_date = intval($row['change_date']);
$change_field = $row['change_field'];
$change_value = $row['change_value'];
$groups = DAO_Group::getAll();
$buckets = DAO_Bucket::getAll();
$url_writer = DevblocksPlatform::getUrlService();
$who = sprintf("%d-%s",
$worker->id,
DevblocksPlatform::strToPermalink($worker_name)
);

switch($change_field) {
case 'is_waiting':
Expand All @@ -60,19 +66,20 @@ function run() {
'message' => 'activities.ticket.status',
'variables' => array(
'target' => sprintf("[%s] %s", $ticket->mask, $ticket->subject),
'actor' => $worker_name,
'status' => $status_to,
),
'urls' => array(
'target' => $url_writer->writeNoProxy('c=display&mask='.$ticket->mask, true),
'target' => ('c=display&mask=' . $ticket->mask),
'actor' => ('c=profiles&type=worker&who=' . $ticket->mask),
)
);
$actor_context = 'cerberusweb.contexts.worker';
if ($worker_id) {
$worker = DAO_Worker::get($worker_id);
$actor_context_id = $worker->id;
} else {
$actor_context_id = 0;
}
$actor_context = 'cerberusweb.contexts.worker';
break;
case 'is_closed':
$logger->info("[Cerb5Blog.com] Audit_log processing is_closed, ticket_id = " . $ticket_id);
Expand All @@ -86,20 +93,21 @@ function run() {
$activity_point = 'ticket.status.open';
$logger->info("[Cerb5Blog.com] Audit_log Status set to open, ticket_id = " . $ticket_id);
}
$entry = array(
//{{actor}} changed ticket {{target}} to status {{status}}
'message' => 'activities.ticket.status',
'variables' => array(
'target' => sprintf("[%s] %s", $ticket->mask, $ticket->subject),
'status' => $status_to,
),
'urls' => array(
'target' => $url_writer->writeNoProxy('c=display&mask='.$ticket->mask, true),
)
);
$entry = array(
//{{actor}} changed ticket {{target}} to status {{status}}
'message' => 'activities.ticket.status',
'variables' => array(
'target' => sprintf("[%s] %s", $ticket->mask, $ticket->subject),
'actor' => $worker_name,
'status' => $status_to,
),
'urls' => array(
'target' => ('c=display&mask=' . $ticket->mask),
'actor' => ('c=profiles&type=worker&who=' . $ticket->mask),
)
);
$actor_context = 'cerberusweb.contexts.worker';
if ($worker_id) {
$worker = DAO_Worker::get($worker_id);
$actor_context_id = $worker->id;
} else {
$actor_context_id = 0;
Expand All @@ -112,20 +120,21 @@ function run() {
$activity_point = 'ticket.status.deleted';
$save = true;
$status_to = "Deleted";
$entry = array(
//{{actor}} changed ticket {{target}} to status {{status}}
'message' => 'activities.ticket.status',
'variables' => array(
'target' => sprintf("[%s] %s", $ticket->mask, $ticket->subject),
'status' => $status_to,
),
'urls' => array(
'target' => $url_writer->writeNoProxy('c=display&mask='.$ticket->mask, true),
)
);
$entry = array(
//{{actor}} changed ticket {{target}} to status {{status}}
'message' => 'activities.ticket.status',
'variables' => array(
'target' => sprintf("[%s] %s", $ticket->mask, $ticket->subject),
'actor' => $worker_name,
'status' => $status_to,
),
'urls' => array(
'target' => ('c=display&mask=' . $ticket->mask),
'actor' => ('c=profiles&type=worker&who=' . $ticket->mask),
)
);
$actor_context = 'cerberusweb.contexts.worker';
if ($worker_id) {
$worker = DAO_Worker::get($worker_id);
$actor_context_id = $worker->id;
} else {
$actor_context_id = 0;
Expand Down

0 comments on commit 94ca868

Please sign in to comment.