require_once "oob" . DIRECTORY_SEPARATOR . "librerias" . DIRECTORY_SEPARATOR . "smarty" . DIRECTORY_SEPARATOR . "Smarty.class.php"; // start smarty object for section template $extpl = new Smarty(); $extpl->template_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'perspectives' . DIRECTORY_SEPARATOR . 'default'; $extpl->compile_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'archivos' . DIRECTORY_SEPARATOR . 'cache'; $extpl->debugging = false; $extpl->force_compile = false; $extpl->caching = 0; $extpl->compile_check = false; //end smarty load $extpl->assign("error_numero", $e->getCode()); $extpl->assign("error_mensaje", $e->getUserMessage()); $extpl->display("error.tpl"); if (502 > $e->getCode() && $e->getCode() < 400) { $e->logmessage(); } else { header("HTTP/1.1 {$e->getCode()} {$e->getUserMessage()}"); $msg = utf8_decode($e->getUserMessage()); header("message: {$msg} "); } require_once "oob" . DIRECTORY_SEPARATOR . "OOB_ext_comunication.php"; // RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_message($e->getUserMessage()); $obj_comunication->set_code($e->getCode()); $obj_comunication->set_data(''); $obj_comunication->send(true); } ?>
case "string": $operador_inicio = " LIKE '%"; $operador_fin = "%'"; break; case "numeric": $operador_inicio = $operadores[$filtro['comparison']]; $operador_fin = ""; break; } $where .= " AND {$filtro['field']} {$operador_inicio}{$filtro['value']}{$operador_fin} "; } //end each } //FIN DE FILTROS $return = array(); $i = 0; if ($roles = seguridad_role::search(DELETED, 'name', $where, $start, $count, OPERATOR_DISTINCT)) { foreach ($roles as $r) { $return[$i]['id'] = $r->get('role'); $return[$i]['name'] = $r->get('name'); $return[$i]['description'] = $r->get('description'); $i++; } } $result = array(); $result["totalCount"] = seguridad_role::roleCount("", "", $where); $result["topics"] = $return; //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($result); $obj_comunication->send(true, true);
$chk_confiados = PhpExt_Form_Checkbox::createCheckbox("chk_confiados", "Confiado")->setMsgTarget(PhpExt_Form_FormPanel::MSG_TARGET_SIDE)->setWidth($field_width); //Boton grabar OnClick $handler_grabar = " \nfunction(){\nthis.findParentByType('form').getForm().submit(\n\t{ \t \n\t\t\t\t\t\t reset : true,\n\t\t\t\t\t waitMsg : 'Enviando Datos',\n\t\t\t\t\t waitTitle : 'Emporika',\t\t\t\t \n\t\t\t grid_reload_id : '{$grid_id}',\n\t\t\t\t new_tab_dir : '/seguridad/role/update',\n\t\t\t\t new_tab_title : 'Modificar Rol',\n new_tab_pass_response_params : { id : 'id'}, \n\t\t\t\t load_tab_here : true\t \n\t}\n\t\n\t);\t\t\t\t\n\t\n}"; $btn_grabar = PhpExt_Button::createTextButton("Grabar", new PhpExt_JavascriptStm($handler_grabar)); //Data_Reader para leer los resultados devueltos $error_reader = new PhpExt_Data_JsonReader(); $error_reader->setRoot("errors"); $error_reader->setSuccessProperty("success"); $error_reader->addField(new PhpExt_Data_FieldConfigObject("id")); $error_reader->addField(new PhpExt_Data_FieldConfigObject("msg")); //formulario que contiene todos los controles $frm_nuevo_rol = new PhpExt_Form_FormPanel(); $frm_nuevo_rol->setErrorReader($error_reader)->setUrl("/seguridad/role/new_process")->setFrame(true)->setWidth(350)->setAutoHeight(true)->setTitle("Datos del Rol")->setMethod(PhpExt_Form_FormPanel::METHOD_POST); //marco para poner los controles $marco = new PhpExt_Form_FieldSet(); $marco->setDefaults(new PhpExt_Config_ConfigObject(array("width" => 210)))->setAutoHeight(true); //agrego todos los controles al marco $marco->addItem($txt_nombre); $marco->addItem($txt_descripcion); $marco->addItem($chk_anonimo); $marco->addItem($chk_confiados); $frm_nuevo_rol->addItem($marco); $frm_nuevo_rol->addButton($btn_grabar); $frm_nuevo_rol->addButton(PhpExt_Button::createTextButton("Cancelar")); //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($frm_nuevo_rol->getJavascript(false, "contenido")); $obj_comunication->send(true); ?>
//LIBRERIAS include_once 'PhpExt/Javascript.php'; PhpExt_Javascript::sendContentType(); include_once 'PhpExt/Ext.php'; include_once 'PhpExt/Button.php'; include_once 'PhpExt/Form/FormPanel.php'; include_once 'PhpExt/Form/Label.php'; global $ari; $ari->popup = 1; // no mostrar el main_frame //BOTON BORRAR ONCLICK $handler_clear = "function(){\n\t\t\n\tExt.MessageBox.confirm('Emporika', 'Esta seguro que desea borrar la cache?',\t\n\t\n\tfunction(e){\n\tif( e == 'yes'){\t\t\n\t this.findParentByType('form').getForm().submit({ \t \n\t waitMsg:'Borrando cache..',\t \n\t waitTitle:'Emporika'\n\t}\n\t);\n\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t},this);\t\t\n\t\n\t\t\t\t\t\t}"; //CREACION DE CONTROLES //LABEL $lbl_borrar = new PhpExt_Form_Label(); $lbl_borrar->setText("Al presionar el boton usted borrara la cache del sistema"); //BOTON BORRAR $clear_button = PhpExt_Button::createTextButton("Borrar", new PhpExt_JavascriptStm($handler_clear)); //FORMULARIO $frm_borrar_cache = new PhpExt_Form_FormPanel(); $frm_borrar_cache->setFrame(true)->setWidth(350)->setUrl("/admin/config/cache_process")->setAutoHeight(true)->setTitle("Borrar Cache")->setMethod(PhpExt_Form_FormPanel::METHOD_POST); //AGREGO LOS CONTROLES $frm_borrar_cache->addItem($lbl_borrar); $frm_borrar_cache->addButton($clear_button); //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($frm_borrar_cache->getJavascript(false, "contenido")); $obj_comunication->send(true); ?>
// menu JSON para EXT-JS //error_reporting(0); global $ari; $ari->popup = 1; // no mostrar el main_frame $menu = oob_module::adminFullMenu(); $json_menu = array(); foreach ($menu as $datos_padre) { $padre = array(); $padre['cls'] = 'Father-node'; $padre['leaf'] = false; $padre['text'] = $datos_padre['name']; $padre['id'] = $datos_padre['id']; $padre['children'] = array(); if (isset($datos_padre['menu']) && is_array($datos_padre['menu'])) { foreach ($datos_padre['menu'] as $datos_hijo) { $hijo = array(); $hijo['iconCls'] = 'ChildNode'; $hijo['leaf'] = true; $hijo['text'] = $datos_hijo['name']; $hijo['id'] = array($datos_hijo['name'], $ari->adminaddress . '/' . $datos_hijo['link']); // nombre del tab, url $padre['children'][] = $hijo; } } $json_menu[] = $padre; } //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($json_menu); $obj_comunication->send(true, true);
//BOTON GRABAR ONCLICK $handler_save = " \nfunction(){\n\nvar form = this.findParentByType('form');\nvar selector = form.findBy(function(c){ return (c.xtype == 'itemselector') });\t\n\nif( selector[0].toStore.getCount() == 0 ){\n\tExt.MessageBox.alert( 'Emporika', 'Debe seleccionar un idioma' ); \n\treturn false;\n}\n\nvar a_params = '';\nvar field = form.getForm().findField('txt_valor');\n\nvar predeterminada = form.findBy(function(c){ return ( c.xtype == 'radiogroup' ) });\nvar opt = predeterminada[1].items.items[0];\t\n\nif( field.disabled ){\n\ta_params = { txt_valor : 1 , tipo : 'float', predeterminada : opt.getValue() }\n}else{\n\ta_params = { tipo : 'fixed', predeterminada : opt.getValue() }\n}\n\nform.getForm().submit(\n\t{ \n\t\t waitMsg : 'Enviando Datos',\n\t\t\treset : true,\n\t\t params : a_params,\n\t\twaitTitle : 'Emporika',\n\t success_msg : 'Moneda guardada correctamente',\n grid_reload_id : '{$grid_id}'\n\t \n\t}\n\t);\t\t\t\t\t\n}\n"; $save_button = PhpExt_Button::createTextButton("Grabar", new PhpExt_JavascriptStm($handler_save)); //Data_Reader para leer los resultados devueltos $error_reader = new PhpExt_Data_JsonReader(); $error_reader->setRoot("errors"); $error_reader->setSuccessProperty("success"); $error_reader->addField(new PhpExt_Data_FieldConfigObject("id")); $error_reader->addField(new PhpExt_Data_FieldConfigObject("msg")); //FORMULARIO $frm_new_currency = new PhpExt_Form_FormPanel(); $frm_new_currency->setErrorReader($error_reader)->setFrame(true)->setUrl("/currency/currency/new_process")->setWidth(400)->setAutoHeight(true)->setTitle("Datos de la moneda")->setMethod(PhpExt_Form_FormPanel::METHOD_POST); //MARCO PARA CONTENER LOS CONTROLES $marco = new PhpExt_Form_FieldSet(); $marco->setAutoHeight(true); //AGREGO TODOS LOS CONTROLES AL MARCO $marco->addItem($txt_moneda); $marco->addItem($txt_signo); $marco->addItem($opt_group_tipo_cambio); $marco->addItem($txt_valor); $marco->addItem($opt_group_predeterminada); $marco->addItem($select_idioma); //AGREGO EL MARCO AL FORMULARIO $frm_new_currency->addItem($marco); //AGREGO LOS BOTONES AL FORMULARIO $frm_new_currency->addButton($save_button); $frm_new_currency->addButton(PhpExt_Button::createTextButton("Cancelar")); //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($frm_new_currency->getJavascript(false, "contenido")); $obj_comunication->send(true);
$permiso['leaf'] = false; $permiso['expanded'] = true; $permiso['id'] = "p_" . $p->get("permission"); $permiso['text'] = $p->get("nicename"); $permiso['children'] = array(); $permiso['iconCls'] = 'Clspermiso'; if ($acciones = seguridad_action::listActionsFor($p, ALL_MENU)) { foreach ($acciones as $a) { $accion = array(); $accion['leaf'] = true; $accion['id'] = "a_" . $a->get("action"); $accion['text'] = $a->get("nicename"); $accion['iconCls'] = 'Clsaccion'; if (seguridad_action::exists($a, $role)) { $accion['checked'] = true; } else { $accion['checked'] = false; } $permiso['children'][] = $accion; } } $padre['children'][] = $permiso; } } $modulos[] = $padre; } } //RESULTADO $obj_comunication = new OOB_ext_comunication(); $obj_comunication->set_data($modulos); $obj_comunication->send(true, true);