예제 #1
0
 public function getContents()
 {
     $table = new MultiModelTable(null);
     $table->setParams(array('fields' => array('system.audit_trail.audit_trail_id', 'system.audit_trail.audit_date', 'system.audit_trail.description', 'system.audit_trail.item_type'), 'conditions' => "user_id = '{$_SESSION['user_id']}'", 'sort_field' => 'audit_trail_id DESC'));
     $table->useAjax = true;
     return $table->render();
 }
예제 #2
0
 public function render()
 {
     if (count($this->listFields) > 0) {
         $fieldNames = $this->listFields;
     } else {
         $fieldNames = $this->getDefaultFieldNames();
     }
     foreach ($fieldNames as $i => $fieldName) {
         $fieldNames[$i] = substr($fieldName, 0, 1) == "." ? $this->redirectedPackage . $fieldName : $fieldName;
     }
     $this->setupList();
     $params["fields"] = $fieldNames;
     $params["page"] = 0;
     $params["sort_field"] = array(array("field" => end(explode('.', reset($fieldNames))), "type" => "DESC"));
     $params['hardConditions'] = $this->listConditions;
     $this->table->setParams($params);
     return $this->toolbar->render() . $this->table->render();
 }
예제 #3
0
 public function table()
 {
     global $redirectedPackage;
     $params = json_decode($_REQUEST["params"], true);
     $redirectedPackage = $params['redirected_package'];
     $modelTable = new MultiModelTable($prefix);
     $modelTable->setOperations($params["operations"]);
     $modelTable->setParams($params);
     $table = $modelTable->render(false);
     $footer = $modelTable->renderFooter();
     $operations = $modelTable->getOperations();
     echo json_encode(array("tbody" => $table, "footer" => $footer, "operations" => $operations));
     die;
 }
예제 #4
0
 public function audit($params)
 {
     $table = new MultiModelTable(null);
     if (count($this->historyModels) > 0) {
         $models = implode("', '", $this->historyModels);
     } else {
         $models = $this->modelName;
     }
     $table->setParams(array('fields' => array('system.audit_trail.audit_trail_id', 'system.audit_trail.audit_date', 'system.audit_trail.description', 'system.users.user_name', 'system.users.first_name', 'system.users.last_name', 'system.users.other_names'), 'filter' => "item_id = ? AND item_type in (?)", 'bind' => [$params[0], $models], 'sort_field' => 'audit_trail_id DESC'));
     $table->useAjax = true;
     return $table->render();
 }