Пример #1
0
 public static function init_dms($skip_login = FALSE)
 {
     // Protect By Login
     if (!is_user_logged_in() && $skip_login == FALSE) {
         wp_redirect(core_utilities::get_login_url());
         exit;
         return;
     }
     global $current_user;
     if ($current_user == null) {
         get_currentuserinfo();
     }
     global $jomiz_dms_settings;
     if ($jomiz_dms_settings == null) {
         $jomiz_dms_settings = new dms_settings();
         $jomiz_dms_settings->init();
     }
     global $jomiz_dms_workflow;
     if ($jomiz_dms_workflow == null) {
         $jomiz_dms_workflow = new dms_workflow();
         $jomiz_dms_workflow->init();
     }
 }
Пример #2
0
 static function display_workflow_data($args, &$last_sender_id = -1)
 {
     $workflow_data_pod;
     if ($args == null) {
         $podname = $_GET['podname'];
         $record_id = $_GET['record-id'];
         $workflow_data_pod = dms_workflow::get_workflow_data_of_record($podname, $record_id);
     } elseif (is_array($args)) {
         $podname = $args[0];
         $record_id = $args[1];
         $workflow_data_pod = dms_workflow::get_workflow_data_of_record($podname, $record_id);
     } else {
         $workflow_data_pod = $args;
     }
     $display_result = "";
     if ($workflow_data_pod->total() > 0) {
         $display_result = '<div class="table-responsive"><table class="table table-striped table-bordered table-condensed"><thead><tr>';
         $display_result .= "<th>Action</th>";
         $display_result .= "<th>Sender</th>";
         $display_result .= "<th>Recipient</th>";
         $display_result .= "<th>On</th>";
         $display_result .= "<th>Notes</th>";
         $display_result .= "</tr></thead><tbody>";
         while ($workflow_data_pod->fetch()) {
             $display_result .= "<tr>";
             $display_result .= "<td>" . $workflow_data_pod->display("chosen_option_text") . "</td>";
             $display_result .= "<td>" . $workflow_data_pod->display("sender_user") . "</td>";
             $display_result .= "<td>" . $workflow_data_pod->display("recipient_user") . "</td>";
             $display_result .= "<td>" . $workflow_data_pod->display("created") . "</td>";
             $display_result .= "<td>" . $workflow_data_pod->display("remarks") . "</td>";
             $display_result .= "</tr>";
             if ($last_sender_id == -1) {
                 $last_sender_id = $workflow_data_pod->field("sender_user.id");
             }
         }
         $display_result .= '</tbody></table></div>';
     }
     return $display_result;
 }
Пример #3
0
    echo "<div>Error: No Operation.</div>";
    return;
}
switch ($operation) {
    case 'filter-control':
        echo dms_api::gui_filter_control();
        break;
    case 'filter-pod':
        echo dms_api::gui_filter_pod();
        break;
    case 'add-workflow-step':
        echo dms_api::workflow_save();
        break;
    case 'get-workflow-data-of-record':
        $last_sender_id = -1;
        echo dms_workflow::display_workflow_data(null, $last_sender_id);
        break;
    case 'upload_file':
        echo dms_attachments::upload_attachment();
        break;
    case 'get_data':
        echo dms_api::data_general_pod();
        break;
    case 'attachment-listing':
        echo dms_attachments::build_table_for_api();
        break;
    case 'delete-attachment':
        echo dms_attachments::delete_attachment();
        break;
    case 'debug':
        echo do_debug_problem();