48); $_result['visibility'] = array(); $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); } require('../include/base.events.php'); $_morecolumns = ""; if( !isset($_id) and $id != '' ) $_id = rand(1, 100000000); $responsabilidad = sessionget('form_responsabilidad_responsabilidad' . $_id); //logToFile('responsabilidad: ' . print_r($responsabilidad, true)); if( empty($_x) or in('onopen', $_x) ) { if( $id != "" and $id != "0" ) { $responsabilidad = loadObject($Link, "procesos.responsabilidad", $id); } else { $responsabilidad = newObject($Link, "procesos.responsabilidad"); //fillobjectfromrequest($responsabilidad); } } if( isormObject($responsabilidad) ) updateObjectFromRequest($Link, $responsabilidad); //makeglobals($responsabilidad, array('id', 'responsabilidad')); if( isset($_x) ) $_initialvars = arrayExclude(get_defined_vars(), array("_*", "form_*", "s_*", "GLOBALS", "Link", "thisname")); //$_initialvars['responsabilidad'] = objectToStructure($responsabilidad); if( isormObject($responsabilidad) ) $_initialvars = array_merge($_initialvars, objectToStructure($responsabilidad)); if( isormObject($responsabilidad) ) $responsabilidad->makeglobals(); //logToFile('responsabilidad after uofr: ' . print_r($responsabilidad, true)); // isbasewindow: // On Open while( ($__action == "" or $__action == "executedonopen") and (empty($_x) or in('onopen', $_x)) ) { $__action = "executedonopen"; $__tempresult = sqlexec($Link, "select title from ddform where concat(module, '.', name) = '" . mysql_escape($form) . "'"); while( $__temprow = mysql_fetch_array($__tempresult)) { $title = $__temprow[0]; } // Si puso header location para ir a otra pagina cierra el script if( !isset($_x) and $__exiting ) { disconnectDb($Link); exit(0); } break; } // PHP Vars while( ($__action == "" or $__action == "executedonopen") and isset($_GET['_x']) and empty($_x) ) { $__row0 = array(); $__row0['__responsabilidad__1'] = ($id == "" ) ? 'listmode' : 'editmode' ; $__row0['__responsabilidad__2'] = $_id ; $__row0['__responsabilidad__3'] = $id == '0' ? 'Nuevo ' : '' ; $__row0['__responsabilidad__4'] = "Responsabilidad - $title" ; $__row0['__responsabilidad__5'] = $id > 0 ? ('#' . $id) : '' ; $__row0['__responsabilidad__6'] = "Responsabilidad - $title" ; $__row0['__responsabilidad__7'] = buildUrlQueryFromGet(array('id' => '0', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__responsabilidad__8'] = "Responsabilidad - $title" ; $__row0['__responsabilidad__9'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__responsabilidad__10'] = $s_perfil != 'Superusuario' ? 'display: none !important;' : '' ; $__row0['__responsabilidad__11'] = buildUrlQueryFromGet(array('id' => '_delete_', 'message' => '_delete_', 'errors' => '_delete_')) ; $__row0['__condicion__1'] = encodehtml($responsabilidad->condicion) ; $__row0['__orden__1'] = $responsabilidad->orden ; $__row0['__form__1'] = $responsabilidad->form ; $_result['morevars'] = $__row0; break; } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { require_once('../include/fpdfreport.php'); $_pdf = new PDF((isset($_orientation) ? $_orientation : 'P'),'pt', (isset($_size) ? $_size : 'A4' )); $_pdf->initialPage = ($_page != '' ? $_page : 1); //$_pdf->SetAutoPageBreak(true); $_pdf->title = ""; $_pdf->SetTopMargin(50); $_pdf->AliasNbPages(); $_pdf->AddPage(); } if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->title = "Responsabilidad - $title"; //$_pdf->drawText("Responsabilidad - $title",'Arial','',14); } if( has($_x, 'responsabilidad_list') ) { if( $_reorder != '' ) { $_changes = split('/', $_reorder); foreach($_changes as $_change) { $_change0 = split('-', $_change); $_id = $_change0[0]; $_position = $_change0[1]; $_table = 'responsabilidad'; sqlexec($Link, "update $_table set position = $_position where id = $_id"); } } //logToFile('[responsabilidad_list] ' . print_r($_REQUEST, true) ); $q = $search['value']; $_order = "order by " . ($order[0]['column'] + 1) . " " . $order[0]['dir']; if( $order[0]['column'] == '' ) $_order = $orderby ; if( $start == '' ) $start = 0; if( $length == '' ) $length = 50; else if( $length == '-1' ) $length = 10000; $_additionalfilter = substr(getaccess(getSelfWindow(), 'buscar'), 14); if( trim($_additionalfilter) == '' ) $_additionalfilter = '1 = 1'; if( hasfeature('procesos.responsabilidad', 'procesos') ) $_morecolumns = ", status"; if( isset($my) and $my == 'mine' ) { if( isset($status) ) $_order = " and (select count(*) from emresp where form = 'procesos.responsabilidad' and objeto = responsabilidad.id and usuario = '$s_idusuario' and estado = '$status') > 0 " . $_order; else $_order = " and (select count(*) from emresp where form = 'procesos.responsabilidad' and objeto = responsabilidad.id and usuario = '$s_idusuario') > 0 " . $_order; } if( isset($status) ) $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS responsabilidad.id, (select temp.nombre from cmcont as temp where temp.id = responsabilidad.usuario) as usuario, responsabilidad.estado, responsabilidad.condicion, responsabilidad.orden, responsabilidad.activo $_morecolumns from responsabilidad where ($_additionalfilter) and (form = '" . mysql_escape($form) . "') and (responsabilidad.status = '" . mysql_escape($status) . "') $_order limit $start, $length"); else $_result['data'] = sqltotablearray($Link, "select SQL_CALC_FOUND_ROWS responsabilidad.id, (select temp.nombre from cmcont as temp where temp.id = responsabilidad.usuario) as usuario, responsabilidad.estado, responsabilidad.condicion, responsabilidad.orden, responsabilidad.activo $_morecolumns from responsabilidad where ($_additionalfilter) and (form = '" . mysql_escape($form) . "') $_order limit $start, $length"); $_result['draw'] = 0; $_result['recordsTotal'] = sqlget($Link, "select found_rows()"); $_result['recordsFiltered'] = $_result['recordsTotal']; //sizeof($_result['data']); //$_result['recordsFiltered'] = 50; print(json_encode($_result)); disconnectDb($Link); exit(0); } // aca iba session get, uofr y load/saveobject while( has($_x, 'responsabilidad_init') ) { $_result['responsabilidad'] = $responsabilidad->toarray(false); break; } while( has($_x, 'responsabilidad') ) { $responsabilidad->saveChanges(); //if( $errors == "" ) // validateresponsabilidad(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($responsabilidad)); saveObject($Link, $responsabilidad); if( hasfeature('procesos.responsabilidad', 'procesos') ) { require_once('../include/easyflexa.php'); if( $id == 0 ) setresponsables($responsabilidad); controlstatus($responsabilidad); } $id = $responsabilidad->id; //logToFile(objectToText($responsabilidad)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_responsabilidad_responsabilidad' . $_id, $responsabilidad); if( $_result['redirect'] == '' ) redirect("?id=$id"); } break; } while( has($_x, 'responsabilidad__delete') ) { //if( $errors == "" ) // validateresponsabilidad(); if( $errors == "" ) { //logToFile("BEFORE SAVE: " . objectToHtml($responsabilidad)); deleteObject($Link, $responsabilidad); //logToFile(objectToText($responsabilidad)); if( $_redirect != "" ) redirect($_redirect); sessionset('form_responsabilidad_responsabilidad' . $_id, null); if( $_result['redirect'] == '' ) { $_result['redirect'] = "?message=Responsabilidad - $title eliminado"; } } break; } while( has($_x, 'responsabilidad_unload') ) { // Not used sessionclear('form_responsabilidad_responsabilidad' . $_id); break; } if( has($_x, 'unnamed2') ) { } if( has($_x, 'usuario_select') ) { list($_result['usuario_select'], $_result['usuario_columns'], $_result['usuario_types']) = sqltoarraydd($Link, "select id,contacto from cmcont where tipo = 'Usuario' order by apellido"); } if( has($_x, 'estado_select') ) { list($_result['estado_select'], $_result['estado_columns'], $_result['estado_types']) = sqltoarraydd($Link, "select descripcion, descripcion from estados where form = '" . mysql_escape($form) . "'"); } sessionset('form_responsabilidad_responsabilidad' . $_id, $responsabilidad); //$responsabilidad -> ['changes'] if( isormObject($responsabilidad) ) $responsabilidad->makeglobals(); if( has($_x, 'pdf') or has($_x, 'pdfprint') or has($_x, 'pdfprint2') ) { $_pdf->Output(); } ?> '); //echo(''); echo(''); ?> class="popup" >
data-toplural="yes" data-editable="title">Responsabilidad -