| 1 |
<?php |
<?php |
| 2 |
// $Id: workflow.pages.inc,v 1.1 2008/08/05 01:55:06 jvandyk Exp $ |
// $Id: workflow.pages.inc,v 1.2 2008/10/29 03:13:55 jvandyk Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 15 |
$states_per_page = variable_get('workflow_states_per_page', 20); |
$states_per_page = variable_get('workflow_states_per_page', 20); |
| 16 |
$result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 1 ORDER BY sid"); |
$result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 1 ORDER BY sid"); |
| 17 |
while ($data = db_fetch_object($result)) { |
while ($data = db_fetch_object($result)) { |
| 18 |
$states[$data->sid] = $data->state; |
$states[$data->sid] = check_plain(t($data->state)); |
| 19 |
} |
} |
| 20 |
$deleted_states = array(); |
$deleted_states = array(); |
| 21 |
$result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 0 ORDER BY sid"); |
$result = db_query("SELECT sid, state FROM {workflow_states} WHERE status = 0 ORDER BY sid"); |
| 22 |
while ($data = db_fetch_object($result)) { |
while ($data = db_fetch_object($result)) { |
| 23 |
$deleted_states[$data->sid] = $data->state; |
$deleted_states[$data->sid] = check_plain(t($data->state)); |
| 24 |
} |
} |
| 25 |
$current = workflow_node_current_state($node); |
$current = workflow_node_current_state($node); |
| 26 |
|
|
| 45 |
} |
} |
| 46 |
else { |
else { |
| 47 |
// Regular state. |
// Regular state. |
| 48 |
$state_name = check_plain($states[$history->sid]); |
$state_name = $states[$history->sid]; |
| 49 |
} |
} |
| 50 |
|
|
| 51 |
if (isset($deleted_states[$history->old_sid])) { |
if (isset($deleted_states[$history->old_sid])) { |
| 53 |
$footer_needed = TRUE; |
$footer_needed = TRUE; |
| 54 |
} |
} |
| 55 |
else { |
else { |
| 56 |
$old_state_name = check_plain($states[$history->old_sid]); |
$old_state_name = $states[$history->old_sid]; |
| 57 |
} |
} |
| 58 |
$rows[] = theme('workflow_history_table_row', $history, $old_state_name, $state_name); |
$rows[] = theme('workflow_history_table_row', $history, $old_state_name, $state_name); |
| 59 |
} |
} |
| 68 |
function theme_workflow_history_table_row($history, $old_state_name, $state_name) { |
function theme_workflow_history_table_row($history, $old_state_name, $state_name) { |
| 69 |
return array( |
return array( |
| 70 |
format_date($history->stamp), |
format_date($history->stamp), |
| 71 |
$old_state_name, |
check_plain(t($old_state_name)), |
| 72 |
$state_name, |
check_plain(t($state_name)), |
| 73 |
theme('username', $history), |
theme('username', $history), |
| 74 |
filter_xss($history->comment, array('a', 'em', 'strong')), |
filter_xss($history->comment, array('a', 'em', 'strong')), |
| 75 |
); |
); |
| 90 |
* Theme the current state in the workflow history table. |
* Theme the current state in the workflow history table. |
| 91 |
*/ |
*/ |
| 92 |
function theme_workflow_current_state($state_name) { |
function theme_workflow_current_state($state_name) { |
| 93 |
return '<strong>'. check_plain($state_name) .'</strong>'; |
return '<strong>'. check_plain(t($state_name)) .'</strong>'; |
| 94 |
} |
} |
| 95 |
|
|
| 96 |
/** |
/** |
| 97 |
* Theme a deleted state in the workflow history table. |
* Theme a deleted state in the workflow history table. |
| 98 |
*/ |
*/ |
| 99 |
function theme_workflow_deleted_state($state_name) { |
function theme_workflow_deleted_state($state_name) { |
| 100 |
return check_plain($state_name) .'*'; |
return check_plain(t($state_name)) .'*'; |
| 101 |
} |
} |
| 102 |
|
|
| 103 |
/** |
/** |
| 124 |
$wid = workflow_get_workflow_for_type($node->type); |
$wid = workflow_get_workflow_for_type($node->type); |
| 125 |
$workflow = workflow_load($wid); |
$workflow = workflow_load($wid); |
| 126 |
$form['#wf'] = $workflow; |
$form['#wf'] = $workflow; |
| 127 |
$name = check_plain($workflow->name); |
$name = check_plain((t($workflow->name))); |
| 128 |
// See if scheduling information is present. |
// See if scheduling information is present. |
| 129 |
if ($node->_workflow_scheduled_timestamp && $node->_workflow_scheduled_sid) { |
if ($node->_workflow_scheduled_timestamp && $node->_workflow_scheduled_sid) { |
| 130 |
global $user; |
global $user; |