Ejemplo n.º 1
0
 public function resetTableColumnToDefault($result)
 {
     // get data from class
     $obj = R3Controller::factory(array('on' => $this->module));
     $tableConfig = new R3BaseTableConfig(R3AuthInstance::get());
     $tableConfig->resetConfig($this->module);
     return array('status' => R3_AJAX_NO_ERROR);
 }
Ejemplo n.º 2
0
 function ApplyData($data = null, array $validActions = array('add', 'mod', 'del'))
 {
     if ($data === null) {
         $data = $this->request;
     }
     if (!in_array($data['act'], $validActions)) {
         throw new Exception("Invalid action [{$data['act']}] for ApplyData");
     }
     $funcName = 'do' . UCFirst($data['act']);
     if (is_callable(array($this, $funcName))) {
         return $this->{$funcName}($data);
     } else {
         throw new Exception('Function ' . R3Controller::getObjectType($_REQUEST) . '::' . $funcName . ' not found');
     }
 }
Ejemplo n.º 3
0
/* ---------------- Startup ------------------------------------------------- */
R3AppStart('admin', array('auth' => true, 'auth_manager' => false));
/* ---------------- Authenticazion ------------------------------------------ */
require_once R3_LIB_DIR . 'obj.base.php';
$objName = R3Controller::getObjectType($_REQUEST);
$objAction = R3Controller::getObjectAction($_REQUEST);
$objNameUC = strToUpper($objName);
$objActionUC = strToUpper($objAction);
/* ---------------- jqGrid translation -------------------------------------- */
if (defined('USE_JQGRID')) {
    if (!isset($_GET['order']) && isset($_GET['sidx']) && isset($_GET['sord'])) {
        $_GET['order'] = "{$_REQUEST['sidx']}|{$_REQUEST['sord']}";
    }
}
/* ---------------- Factory ------------------------------------------------- */
$obj = R3Controller::factory($_REQUEST);
$obj->setAuth($auth);
if (is_callable(array($obj, 'checkPerm'))) {
    $obj->checkPerm();
} else {
    if (!$auth->hasPerm($objActionUC, $objNameUC)) {
        die(sprintf(_("PERMISSION DENIED [%s/%s]"), $objActionUC, $objNameUC));
    }
}
/* ---------------- AJAX call ----------------------------------------------- */
$obj->processAjaxRequest();
$pageTitle = $obj->getPageTitle();
$htmlFilter = $obj->getHTMLFilter();
$htmlTable = $obj->getHTMLTable();
$totRecord = $obj->getTotRecord();
$htmlTableLegend = $obj->getHTMLTableLegend();