Enable admin to enter installation date on delivery process:
:
This commit is contained in:
@@ -16,12 +16,40 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
|
||||
add_filter('gravityflow_admin_action_feedback', array(__CLASS__, 'maybe_process_admin_step_change_action'), 10, 4);
|
||||
|
||||
add_filter('gravityflow_admin_actions_workflow_detail', array(__CLASS__, 'remove_workflow_admin_actions'));
|
||||
add_filter('gravityflow_admin_actions_workflow_detail', array(__CLASS__, 'filter_workflow_admin_actions'), 10, 5);
|
||||
}
|
||||
|
||||
public static function remove_workflow_admin_actions() {
|
||||
/**
|
||||
* Filter workflow admin actions
|
||||
*
|
||||
* @param $admin_actions
|
||||
* @param $current_step
|
||||
* @param $steps
|
||||
* @param $form
|
||||
* @param $entry
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function filter_workflow_admin_actions($admin_actions, $current_step, $steps, $form, $entry) {
|
||||
|
||||
return array();
|
||||
$allowed_actions = array();
|
||||
|
||||
// allow basic admin actions for step action workflow
|
||||
if (Wiaas_Delivery_Process_Action::is_action_form($form)) {
|
||||
|
||||
$allowed_actions = array( 'cancel_workflow', 'restart_workflow', 'restart_step');
|
||||
}
|
||||
|
||||
$filtered_admin_actions = array();
|
||||
|
||||
foreach ( $admin_actions as $admin_action ) {
|
||||
|
||||
if (in_array($admin_action['value'], $allowed_actions)) {
|
||||
$filtered_admin_actions[] = $admin_action;
|
||||
}
|
||||
}
|
||||
|
||||
return $filtered_admin_actions;
|
||||
}
|
||||
|
||||
public static function render_procurement_order_download_link($form, $entry, $current_step) {
|
||||
@@ -269,74 +297,53 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
</h3>
|
||||
|
||||
<?php
|
||||
if ($is_current_step) {
|
||||
Gravity_Flow_Entry_Detail::maybe_show_instructions(true, true, $current_step, $form, $entry);
|
||||
Gravity_Flow_Entry_Detail::maybe_show_instructions(true, true, $current_step, $form, $entry);
|
||||
|
||||
$action_form = GFAPI::get_form( $step->target_form_id );
|
||||
$action_form = GFAPI::get_form( $step->target_form_id );
|
||||
|
||||
if (empty($action_form)) {
|
||||
if (empty($action_form)) {
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$action_delivery_settings = rgar($action_form, 'wiaas_delivery_process');
|
||||
|
||||
?>
|
||||
|
||||
<div class="submitbox" style="padding: 10px;">
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if (! $action_delivery_settings['automatic_action_entries_enabled']) {
|
||||
|
||||
$form_url = admin_url( 'admin-ajax.php' ) .
|
||||
'?action=wiaas_delivery_get_form&order_id=' . $order_id .
|
||||
'&form_id=' . $action_form['id'] .
|
||||
'&wiaas_delivery_process_id=' . $entry['id'];
|
||||
$form_url .= '&is_admin=1';
|
||||
|
||||
$form_link = sprintf(
|
||||
'<a href="%s&TB_iframe=true&width=600&height=550" class="button button-primary thickbox">' .
|
||||
'<i class="fa fa-plus"></i> ' . $action_form['title'] . '</a>',
|
||||
$form_url );
|
||||
|
||||
echo $form_link;
|
||||
}
|
||||
|
||||
echo '<br><br><br>';
|
||||
|
||||
$page_size = 20;
|
||||
$search_criteria = array(
|
||||
'status' => 'active',
|
||||
'field_filters' => array(
|
||||
array( 'key' => 'wiaas_delivery_process_id',
|
||||
'value' => $entry['id']
|
||||
),
|
||||
),
|
||||
);
|
||||
$sorting = array( 'key' => 'date_created', 'direction' => 'DESC' );
|
||||
$paging = array( 'offset' => 0, 'page_size' => $page_size );
|
||||
|
||||
$entries = GFAPI::get_entries( $action_form['id'], $search_criteria, $sorting, $paging );
|
||||
|
||||
foreach ($entries as $action_entry) {
|
||||
self::_display_step_action_entry($action_form, $action_entry);
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
continue;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="submitbox" style="padding: 10px;">
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<?php
|
||||
echo '<br><br><br>';
|
||||
|
||||
$page_size = 20;
|
||||
$search_criteria = array(
|
||||
'status' => 'active',
|
||||
'field_filters' => array(
|
||||
array( 'key' => 'wiaas_delivery_process_id',
|
||||
'value' => $entry['id']
|
||||
),
|
||||
),
|
||||
);
|
||||
$sorting = array( 'key' => 'date_created', 'direction' => 'DESC' );
|
||||
$paging = array( 'offset' => 0, 'page_size' => $page_size );
|
||||
|
||||
$entries = GFAPI::get_entries( $action_form['id'], $search_criteria, $sorting, $paging );
|
||||
|
||||
foreach ($entries as $action_entry) {
|
||||
self::_display_step_action_entry($action_form, $action_entry);
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
?>
|
||||
|
||||
</div>
|
||||
@@ -349,6 +356,13 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
|
||||
$current_action_step = $workflow_api->get_current_step($action_entry);
|
||||
|
||||
$entry_url = add_query_arg( array(
|
||||
'page' => 'gravityflow-inbox',
|
||||
'view' => 'entry',
|
||||
'id' => $action_entry['form_id'],
|
||||
'lid' => $action_entry['id']
|
||||
), admin_url() );
|
||||
|
||||
|
||||
?>
|
||||
<table>
|
||||
@@ -384,15 +398,15 @@ class Wiaas_Admin_Order_Process_Flow {
|
||||
<strong>
|
||||
|
||||
<?php
|
||||
if (! empty($current_action_step)) {
|
||||
echo $current_action_step->get_status_label($current_action_step->get_status()) . ': ' . $current_action_step->get_name();
|
||||
echo '<a target="_blank" href="' . $current_action_step->get_entry_url() . '">' .
|
||||
' <i class="fa fa-external-link" style="font-size: 16px;"></i>' .
|
||||
'</a>';
|
||||
|
||||
} else {
|
||||
echo $workflow_api->get_status($action_entry);
|
||||
}
|
||||
echo empty($current_action_step) ?
|
||||
$workflow_api->get_status($action_entry) :
|
||||
$current_action_step->get_status_label($current_action_step->get_status()) . ': ' . $current_action_step->get_name();;
|
||||
|
||||
echo '<a target="_blank" href="' . $entry_url . '">' .
|
||||
' <i class="fa fa-external-link" style="font-size: 16px;"></i>' .
|
||||
'</a>';
|
||||
|
||||
?>
|
||||
|
||||
</strong>
|
||||
|
||||
Reference in New Issue
Block a user