status = sqlget($Link, "select descripcion from estados where form = '$_form' and activo = 'S' order by orden limit 1"); } $_def = sqltoarray($Link, "select * from ddform where concat(module, '.', name) = '$_form'"); logToFile("procesos enform form $_form"); $_dbtable = $_def[0]['dbtable']; $_dbwhere = $_def[0]['dbwhere']; if( $_dbwhere != '' ) $_dbwhere .= ' and '; if( $_where != '' ) $_dbwhere = '(' . $_where . ') and ' . $_dbwhere; $_dbwhere = $_additionalfilter; if( $id != '' and $id != '0' ) { $estado2 = sqlget($Link, "select status from $_dbtable where id = $id"); $_rows = sqltoarray($Link, "select descripcion as text, notas as tooltip, concat(if(orden <= (select orden from estados where form = '$_form' and descripcion = '$estado2'), 'active', ''),if(descripcion = '$estado2',' active2','')) as class, (select cmcont.alias from cmcont cross join emresp on cmcont.id = emresp.usuario where emresp.form = '$_form' and emresp.objeto = $id and emresp.estado = estados.descripcion) as badge, concat('width: ', round(length(descripcion) * 12 - (length(descripcion)-length(replace(descripcion ,' ',''))) * 4,0), 'px') as style, (select cmcont.id from cmcont cross join emresp on cmcont.id = emresp.usuario where emresp.form = '$_form' and emresp.objeto = $id and emresp.estado = estados.descripcion) as idresponsable from estados where form = '$_form' and activo = 'S' order by orden"); } else if( $id != '0') { $_rows = sqltoarray($Link, "select descripcion as text, notas as tooltip, if(descripcion = '$status', 'active', '') as class, (select count(*) from $_dbtable where $_dbwhere status = estados.descripcion) as badge, concat('width: ', round(length(descripcion) * 20 - (length(descripcion)-length(replace(descripcion ,' ',''))) * 4,0), 'px') as style from estados where form = '$_form' and activo = 'S' order by orden"); debug(sizeof($_rows) . ' rows'); } ?>
    $_row) { ?>