Example #1
1
function Main()
{
    global $TPLV, $bottom, $urls, $db, $migalha;
    $TPLV = new TemplatePower(TEMPLATE_PATH . "modulos/categoria.tpl");
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH_SITE);
    $TPLV->assignGlobal("imagePath", IMAGE_PATH);
    $TPLV->assignGlobal("swfPath", SWF_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH_SITE);
    $TPLV->assignGlobal('navBottom', $bottom);
    $TPLV->assignGlobal($urls->var);
    $TPLV->prepare();
    $in = $_GET['in'];
    switch ($in) {
        default:
        case 'lista':
            lista();
            break;
        case 'novo':
            novo();
            break;
        case 'editar':
            editar();
            break;
        case 'salvar':
            salvar();
            break;
        case 'deletar':
            deletar();
            break;
    }
}
Example #2
0
function Main()
{
    global $TPLV, $urls, $usuario, $imovel;
    $TPLV = new TemplatePower(TEMPLATE_PATH . "login.tpl");
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
    $TPLV->assignGlobal("imagePath", IMAGE_PATH);
    $TPLV->assignGlobal("swfPath", SWF_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH);
    $TPLV->assignGlobal('navBottom', $bottom);
    $TPLV->assignGlobal($urls->var);
    $TPLV->prepare();
    $in = $_GET['in'];
    switch ($in) {
        //FILTROS DE BUSCAS
        default:
        case 'deletaUsuario':
            deletaUsuario();
            break;
        case 'deletaMidia':
            deletaMidia();
            break;
            //LOGIN E RECUPERA SENHA
        //LOGIN E RECUPERA SENHA
        case 'getLogin':
            getLogin();
            break;
        case 'login':
            login();
            break;
        case 'getSenha':
            getSenha();
            break;
        case 'recuperaSenha':
            recuperaSenha();
            break;
        case 'isLogado':
            if ($usuario->isLogado()) {
                echo 'logado';
            } else {
                echo 'erro';
            }
            break;
            //CADASTRO
        //CADASTRO
        case 'validaEmailCadastro':
            validaEmailCadastro();
            break;
            //LEADS DETALHES
        //LEADS DETALHES
        case 'getCadastro':
            getCadastro();
            break;
        case 'salvarCadastro':
            salvarCadastro();
            break;
        case 'verificaCPF':
            verificaCPF();
            break;
    }
}
Example #3
0
function Main()
{
    global $TPLV, $bottom, $db, $migalha, $usuario;
    $TPLV = new TemplatePower(TEMPLATE_PATH . "login.tpl");
    $TPLV->assignGlobal("uploadPath", UPLOAD_PATH);
    $TPLV->assignGlobal("imagePath", IMAGE_PATH);
    $TPLV->assignGlobal("swfPath", SWF_PATH);
    $TPLV->assignGlobal("localPath", LOCAL_PATH);
    $TPLV->assignGlobal('navBottom', $bottom);
    $TPLV->prepare();
    $in = $_GET['in'];
    switch ($in) {
        default:
        case 'restrito':
            if ($usuario->isLogado()) {
                inicio();
            } else {
                restrito();
            }
            break;
        case 'inicio':
            inicio();
            break;
        case 'logout':
            logout();
            break;
    }
}
 public function registrar()
 {
     $proteccion = new Proteccion();
     $nombre = $proteccion->html($_POST['nombre']);
     $apellido = $proteccion->html($_POST['apellido']);
     $sexo = $proteccion->html($_POST['sexo']);
     $fecha_nacimiento = $proteccion->html($_POST['fecha_nacimiento']);
     $direccion = $proteccion->html($_POST['direccion']);
     $email = $proteccion->html($_POST['email']);
     $dni = $proteccion->html($_POST['dni']);
     $pass = $proteccion->html($_POST['password']);
     $persona = new Usuario($email, $pass);
     $existe = $persona->existe();
     if ($existe) {
         $tp = new TemplatePower("templates/registro.html");
         $tp->prepare();
         $tp->gotoBlock("_ROOT");
         $tp->newblock("no_registro");
         $tp->assign("usuario", $email);
         $webapp = $tp->getOutputContent();
     } else {
         $persona->setDatosUsuario($nombre, $apellido, $sexo, $fecha_nacimiento, $direccion, $dni);
         $persona->insertar();
         $_SESSION['user'] = $email;
         $tp = new TemplatePower("templates/index.html");
         $tp->prepare();
         $tp->gotoBlock("_ROOT");
         $tp->newBlock("sesion");
         $tp->assign("usuario", $_SESSION['user']);
         $webapp = $tp->getOutputContent();
     }
     echo $webapp;
 }
Example #5
0
function savePluginFile($tplName, $fileName, $fields)
{
    $pluginTpl = PATH_GULLIVER_HOME . 'bin' . PATH_SEP . 'tasks' . PATH_SEP . 'templates' . PATH_SEP . $tplName . '.tpl';
    $template = new TemplatePower($pluginTpl);
    $template->prepare();
    if (is_array($fields)) {
        foreach ($fields as $block => $data) {
            $template->gotoBlock("_ROOT");
            if (is_array($data)) {
                foreach ($data as $rowId => $row) {
                    $template->newBlock($block);
                    foreach ($row as $key => $val) {
                        $template->assign($key, $val);
                    }
                }
            } else {
                $template->assign($block, $data);
            }
        }
    }
    $content = $template->getOutputContent();
    $iSize = file_put_contents($fileName, $content);
    return $iSize;
}
Example #6
0
 private function _extjs()
 {
     G::LoadClass('serverConfiguration');
     $oServerConf =& serverConf::getSingleton();
     $oHeadPublisher =& headPublisher::getSingleton();
     if ($oHeadPublisher->extJsInit === true) {
         $header = $oHeadPublisher->getExtJsVariablesScript();
         $styles = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
         $body = $oHeadPublisher->getExtJsScripts();
         //default
         $templateFile = G::ExpandPath("skinEngine") . 'base' . PATH_SEP . 'extJsInitLoad.html';
         //Custom skins
         if (defined('PATH_CUSTOM_SKINS') && is_dir(PATH_CUSTOM_SKINS . $this->mainSkin)) {
             $templateFile = PATH_CUSTOM_SKINS . $this->mainSkin . PATH_SEP . 'extJsInitLoad.html';
         }
         //Skin uxs - simplified
         if (!isset($_SESSION['user_experience'])) {
             $_SESSION['user_experience'] = 'NORMAL';
         }
         if ($_SESSION['user_experience'] != 'NORMAL') {
             $templateFile = is_dir(PATH_CUSTOM_SKINS . 'uxs') ? PATH_CUSTOM_SKINS . 'simplified' . PATH_SEP . 'extJsInitLoad.html' : $templateFile;
         }
     } else {
         $styles = "";
         $header = $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
         $header .= $oHeadPublisher->includeExtJs();
         $body = $oHeadPublisher->renderExtJs();
         $templateFile = $this->layoutFile['dirname'] . PATH_SEP . $this->layoutFileExtjs['basename'];
     }
     $template = new TemplatePower($templateFile);
     $template->prepare();
     $template->assign('header', $header);
     $template->assign('styles', $styles);
     $template->assign('bodyTemplate', $body);
     $doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
     $meta = null;
     $dirBody = null;
     if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match("/^.*\\(.*MSIE (\\d+)\\..+\\).*\$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
         $ie = intval($arrayMatch[1]);
         $swTrident = preg_match("/^.*Trident.*\$/", $_SERVER["HTTP_USER_AGENT"]) ? 1 : 0;
         //Trident only in IE8+
         $sw = 1;
         if (($ie == 7 && $swTrident == 1 || $ie == 8) && !preg_match("/^ux.+\$/", SYS_SKIN)) {
             //IE8
             $sw = 0;
         }
         if ($sw == 1) {
             if ($ie == 10) {
                 $ie = 8;
             }
             $doctype = null;
             $meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE={$ie}\" />";
         }
     }
     $serverConf =& serverConf::getSingleton();
     if ($serverConf->isRtl(SYS_LANG)) {
         $dirBody = "dir=\"RTL\"";
     }
     $template->assign("doctype", $doctype);
     $template->assign("meta", $meta);
     $template->assign("dirBody", $dirBody);
     echo $template->getOutputContent();
 }
Example #7
0
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
if (isset($_GET['POSITION'])) {
    $_SESSION['STEP_POSITION'] = (int) $_GET['POSITION'];
}
if (isset($_SESSION['CASES_REFRESH'])) {
    unset($_SESSION['CASES_REFRESH']);
    G::evalJScript("if(typeof parent != 'undefined' && parent.refreshCountFolders) parent.refreshCountFolders();");
}
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$G_SUB_MENU = 'caseOptions';
$G_ID_SUB_MENU_SELECTED = '_';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode('
  var Cse = {};
  Cse.panels = {};
  var leimnud = new maborak();
  leimnud.make();
  leimnud.Package.Load("rpc,drag,drop,panel,app,validator,fx,dom,abbr",{Instance:leimnud,Type:"module"});
  leimnud.exec(leimnud.fix.memoryLeak);
  leimnud.event.add(window,"load",function(){
    ' . (isset($_SESSION['showCasesWindow']) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
  });
  ');
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
<?php

session_start();
include "inc.includes.php";
$db = new BaseDatos($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['db']);
$tpl = new TemplatePower("templates/index.html");
$tpl->prepare();
$tpl->gotoBlock("_ROOT");
//isset determina si una variable esta definida o es null
//$_REQUEST tiene el contenido de get y post
if (!isset($_REQUEST["action"]) || $_REQUEST["action"] == "") {
    $tpl->newBlock("contenido");
    $mhotels = new MHotels();
    $result = $mhotels->allhoteles();
    if ($result['found']) {
        foreach ($result['result'] as $r) {
            $tpl->newblock("hotels");
            $tpl->assign("idHotel", $r['id_hotel']);
            $tpl->assign("name", $r['nom_hotel']);
            $tpl->assign("prov", $r['provincia']);
            $tpl->assign("local", $r['localidad']);
            $tpl->assign("calle", $r['calle']);
            $tpl->assign("ncalle", $r['nro_calle']);
            $tpl->assign("tel", $r['telefono']);
            $tpl->assign("precio", $r['precio_persona']);
        }
    } else {
        $tpl->newblock("no_hotels");
    }
    $webapp = $tpl->getOutputContent();
} else {
Example #9
0
<?php

//llamamos al constructor de la plantilla y la preparamos para ser mostrada
$tplCitaRealizar = new TemplatePower("plantilla/cita_realizar.html");
$tplCitaRealizar->prepare();
$citaId = addslashes($_GET['id']);
$query = "SELECT pacientes.nombre_pac, pacientes.historia, citas.fecha, citas.hora, usuarios.nombre \r\n                FROM pacientes, citas\r\n                LEFT JOIN usuarios\r\n                ON citas.responsable=usuarios.usuario\r\n                WHERE citas.id_cita='{$citaId}'\r\n                AND citas.mascota=pacientes.id_pac";
$rec = mysql_query($query);
$datosCita = mysql_fetch_assoc($rec);
//si no hay datos de la cita indicada lo envio a index
if (!$datosCita) {
    echo "NO EXISTEN CITAS";
    exit;
    header("Location: /gicorec/index.php");
    exit;
}
$tplCitaRealizar->assign("nombre_mascota", $datosCita['nombre_pac']);
$tplCitaRealizar->assign("historia", $datosCita['historia']);
$tplCitaRealizar->assign("fecha", $datosCita['fecha']);
$tplCitaRealizar->assign("hora", $datosCita['hora']);
$tplCitaRealizar->assign("vet_responsable", $datosCita['nombre']);
$tplCitaRealizar->assign("id_cita", $citaId);
//imprimimos por pantalla
$tplIndex->assign("contenido", $tplCitaRealizar->getOutputContent());
     $aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
     $output = $oEvent->update($aDataEvent);
     //Show link
     $link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
     print $link;
     //print "\n<a href='$link' target='_new' > $link </a>";
 } else {
     $G_FORM = new Form($sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false);
     $G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
     $scriptCode = '';
     $scriptCode = $G_FORM->render(PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode);
     $scriptCode = str_replace('/controls/', $http . $_SERVER['HTTP_HOST'] . '/controls/', $scriptCode);
     $scriptCode = str_replace('/js/maborak/core/images/', $http . $_SERVER['HTTP_HOST'] . '/js/maborak/core/images/', $scriptCode);
     //render the template
     $pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentry.tpl';
     $template = new TemplatePower($pluginTpl);
     $template->prepare();
     require_once 'classes/model/Step.php';
     $oStep = new Step();
     $sUidGrids = $oStep->lookingforUidGrids($sPRO_UID, $sDYNAFORM);
     $template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
     $template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
     $template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
     $template->assign("sysSys", SYS_SYS);
     $template->assign("sysLang", SYS_LANG);
     $template->assign("sysSkin", SYS_SKIN);
     $template->assign("processUid", $sPRO_UID);
     $template->assign("dynaformUid", $sDYNAFORM);
     $template->assign("taskUid", $sTASKS);
     $template->assign("dynFileName", $sPRO_UID . "/" . $sDYNAFORM);
     $template->assign("formId", $G_FORM->id);
Example #11
0
<?php

session_start();
include "inc/header.php";
include_once "inc/class.TemplatePower.inc.php";
$tpl = new TemplatePower("tpl/projecten.tpl");
$tpl->prepare();
$servername = "localhost";
$username = "******";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM projects WHERE enabled = 1";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while ($row = $result->fetch_assoc()) {
        $tpl->newBlock("project");
        $title = $row["title"];
        $content = $row["summary"];
        $id = $row["id"];
        $tpl->assign("title", "{$title}");
        $tpl->assign("content", "{$content}");
        $tpl->assign("id", "{$id}");
        $tpl->gotoBlock("_ROOT");
    }
Example #12
0
<?php

// Hier laad ik de header.html in
$header = new TemplatePower("template/files/header.tpl");
$header->prepare();
if (!empty($_SESSION['accountid'])) {
    $header->newBlock("LOGGEDIN");
    $header->assign("USERNAME", $_SESSION['username']);
    //    if($_SESSION['roleid'] == 2){
    //        $header->newBlock("ADMINMENU");
    //    }
} else {
    $header->newBlock("LOGINTOP");
}
Example #13
0
 if ($_GET) {
     switch ($_GET[action]) {
         case "deleteall":
             $MessCat = intval($_GET[messcat]);
             if ($MessCat != "100") {
                 $sql = "`message_type` = " . $MessCat . " AND ";
             }
             doquery("DELETE FROM {{table}} WHERE {$sql} message_owner = " . $user[id], 'messages');
             header("Location: " . $_SERVER['PHP_SELF'] . "?messcat=" . $MessCat);
             exit;
             break;
     }
 }
 // ADD SMILIES ARRAY
 makeSmiliesArray();
 $tp = new TemplatePower($ugamela_root_path . TEMPLATE_DIR . TEMPLATE_NAME . "/messages.tpl");
 $tp->prepare();
 $OwnerID = $_GET['id'];
 $MessCategory = isset($_GET['messcat']) ? $_GET['messcat'] : '100';
 $MessPageMode = isset($_GET['mode']) ? $_GET['mode'] : 'show';
 $UsrMess = doquery("SELECT SQL_CACHE * FROM {{table}} WHERE `message_owner` = " . $user['id'] . " ORDER BY `message_time` DESC;", 'messages');
 $UnRead = $user;
 $MessageType = array(100, 0, 1, 2, 3, 4, 5, 15, 99);
 $TitleColor = array(0 => '#FFFF00', 1 => '#FFFF00', 2 => '#FFFF00', 3 => '#FFFF00', 4 => '#FFFF00', 5 => '#FFFF00', 15 => '#FFFF00', 99 => '#FFFF00', 100 => '#FFFF00');
 $BackGndColor = array(0 => '#663366', 1 => '#663366', 2 => '#663366', 3 => '#663366', 4 => '#663366', 5 => '#663366', 15 => '#663366', 99 => '#663366', 100 => '#663366');
 for ($MessType = 0; $MessType < 101; $MessType++) {
     if (in_array($MessType, $MessageType)) {
         $WaitingMess[$MessType] = $UnRead[$messfields[$MessType]];
         $TotalMess[$MessType] = 0;
     }
 }
<?php

$tpl = new TemplatePower('template/eventos/consultaEventos.tpl');
$tpl->prepare();
foreach ($_POST as $nombre_campo => $valor) {
    $asignacion = '$' . $nombre_campo . '=\'' . $valor . '\';';
    if (!is_numeric($nombre_campo)) {
        eval($asignacion);
    }
}
$eventos = new Eventos($conn);
$lista_eventos = $eventos->listaEventos();
foreach ($lista_eventos as $evento) {
    $tpl->newBlock("eventos");
    $tpl->assign("nombre", $evento['nombre']);
    $tpl->assign("f_inicio", $evento['f_inicio']);
    $tpl->assign("f_fin", $evento['f_fin']);
    $tpl->assign("logotipo", $evento['logotipo']);
    $tpl->assign("descripcion", $evento['descripcion']);
    $tpl->assign("id", $evento['id']);
    $tpl->gotoBlock("_ROOT");
}
//$tpl->assign('anterior', $anterior);
//$tpl->assign('siguiente', $siguiente);
$tpl->printToScreen();
?>

Example #15
0
<?php

session_start();
include "inc/header.php";
include_once "inc/class.TemplatePower.inc.php";
$tpl = new TemplatePower("tpl/index.tpl");
$tpl->prepare();
$servername = "localhost";
$username = "******";
$password = "";
$dbname = "grid_imo";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM news";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while ($row = $result->fetch_assoc()) {
        $tpl->newBlock("News");
        $title = $row["title"];
        $news_content = $row["text"];
        $tpl->assign("news_title", "{$title}");
        $tpl->assign("news_content", "{$news_content}");
        $tpl->gotoBlock("_ROOT");
    }
} else {
    $tpl->newBlock("News");
<?php

$content = new TemplatePower("template/files/admin_blog.tpl");
$content->prepare();
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = NULL;
}
if (isset($_SESSION['roleid'])) {
    if ($_SESSION['roleid'] == 2) {
        switch ($action) {
            case "toevoegen":
                if (!empty($_POST['username']) && !empty($_POST['title']) && !empty($_POST['content'])) {
                    // insert
                    // insert
                    $insert_blog = $db->prepare("INSERT INTO blog SET\n                  Username = :username,\n                  Title = :title,\n                  Content = :content,\n                  Accounts_idAccounts = :accountid");
                    $insert_blog->bindParam(":username", $_POST['username']);
                    $insert_blog->bindParam(":title", $_POST['title']);
                    $insert_blog->bindParam(":content", $_POST['content']);
                    $insert_blog->bindValue(":accountid", 4);
                    $insert_blog->execute();
                    $userid = $db->lastInsertId();
                } else {
                    // formulier
                    $content->newBlock("BLOGFORM");
                    $content->assign("ACTION", "index.php?pageid=3&action=toevoegen");
                    $content->assign("BUTTON", "Toevoegen Blog");
                }
                break;
            case "wijzigen":
Example #17
0
<?php

$content = new TemplatePower("template/files/login.tpl");
$content->prepare();
if (isset($_SESSION['accountid'])) {
    // is al ingelogd, dus niks doen
    $content->newBlock("MELDING");
    $content->assign("MELDING", "Je bent al ingelogd");
} else {
    if (!empty($_POST['gnaam']) and !empty($_POST['password'])) {
        // formulier is verstuurd
        $check_user = $db->prepare("SELECT count(*) FROM accounts a, users u\n                                    WHERE a.Users_idUsers = u.idUsers\n                                    AND a.Username = :username\n                                    AND a.Password = :password");
        $check_user->bindParam(":username", $_POST['gnaam']);
        $password = sha1($_POST['password']);
        $check_user->bindParam(":password", $password);
        $check_user->execute();
        if ($check_user->fetchColumn() == 1) {
            // gebruiker gevonden
            $get_user = $db->prepare("SELECT a.*, u.* FROM accounts a, users u\n                                    WHERE a.Users_idUsers = u.idUsers\n                                    AND a.Username = :username\n                                    AND a.Password = :password");
            $get_user->bindParam(":username", $_POST['gnaam']);
            $get_user->bindParam(":password", $password);
            $get_user->execute();
            $user = $get_user->fetch(PDO::FETCH_ASSOC);
            $_SESSION['accountid'] = $user['idAccounts'];
            $_SESSION['username'] = $user['Username'];
            $_SESSION['roleid'] = $user['Role_idRole'];
            $content->newBlock("MELDING");
            $content->assign("MELDING", "Je bent ingelogd");
        } else {
            // gebruiker niet gevonden: combinatie username + password klopt niet
            $errors->newBlock("ERRORS");
Example #18
0
    public function processMap()
    {
        global $G_PUBLISH;
        global $G_CONTENT;
        global $G_FORM;
        global $G_TABLE;
        global $RBAC;
        G::LoadClass('processMap');
        $oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html');
        $oTemplatePower->prepare();
        $G_PUBLISH = new Publisher();
        $G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
        $oHeadPublisher =& headPublisher::getSingleton();
        //$oHeadPublisher->addScriptfile('/jscore/processmap/core/processmap.js');
        $oHeadPublisher->addScriptCode('
    var maximunX = ' . processMap::getMaximunTaskX($_SESSION['PROCESS']) . ';
    window.onload = function(){
      var pb=leimnud.dom.capture("tag.body 0");
      Pm=new processmap();

      var params = "{\\"uid\\":\\"' . $_SESSION['PROCESS'] . '\\",\\"mode\\":false,\\"ct\\":false}";
      // maximun x and y position
      var xPos = 0;
      var yPos = 0;

      //obtaining the processmap object for the current process
      var oRPC = new leimnud.module.rpc.xmlhttp({
        url   : "../processes/processes_Ajax",
        async : false,
        method: "POST",
        args  : "action=load&data="+params
      });

      oRPC.make();
      var response = eval(\'(\' + oRPC.xmlhttp.responseText + \')\');

      for (var i in response){
        if (i==\'task\'){
          elements = response[i];
          for (var j in elements){
            if (elements[j].uid!=undefined){
              if (elements[j].position.x > xPos){
                xPos = elements[j].position.x;
              }
              if (elements[j].position.y > yPos){
                yPos = elements[j].position.y;
              }
            }
          }
        }
      }

      Pm.options = {
        target    : "pm_target",
        dataServer: "../processes/processes_Ajax",
        uid       : "' . $_SESSION['PROCESS'] . '",
        lang      : "' . SYS_LANG . '",
        theme     : "processmaker",
        size      : {w:xPos+800,h:yPos+150},
        images_dir: "/jscore/processmap/core/images/",
        rw        : false,
        hideMenu  : false
      }
      Pm.make();

      oLeyendsPanel = new leimnud.module.panel();
      oLeyendsPanel.options = {
        size  :{w:260,h:155},
        position:{x:((document.body.clientWidth * 95) / 100) - ((document.body.clientWidth * 95) / 100 - (((document.body.clientWidth * 95) / 100) - 260)),y:45,center:false},
        title :G_STRINGS.ID_COLOR_LEYENDS,
        theme :"processmaker",
        statusBar:false,
        control :{resize:false,roll:false,drag:true,close:false},
        fx  :{modal:false,opacity:false,blinkToFront:true,fadeIn:false,drag:false}
      };
      oLeyendsPanel.setStyle = {
        content:{overflow:"hidden"}
      };
      oLeyendsPanel.events = {
        remove: function() {delete(oLeyendsPanel);}.extend(this)
      };
      oLeyendsPanel.make();
      oLeyendsPanel.loader.show();
      var oRPC = new leimnud.module.rpc.xmlhttp({
        url : "cases_Ajax",
        args: "action=showLeyends"
      });
      oRPC.callback = function(rpc){
        oLeyendsPanel.loader.hide();
        var scs=rpc.xmlhttp.responseText.extractScript();
        oLeyendsPanel.addContent(rpc.xmlhttp.responseText);
      }.extend(this);
      oRPC.make();
    }');
        G::RenderPage('publish', 'blank');
    }
Example #19
0
    /**
     * DEPRECATED createPropelClasses()
     *
     * Don't use this method, it was left only for backward compatibility
     * for some external plugins that still is using it
     */
    public function createPropelClasses($sTableName, $sClassName, $aFields, $sAddTabUid, $connection = 'workflow')
    {
        try {
            /* $aUID = array('FLD_NAME'           => 'PM_UNIQUE_ID',
              'FLD_TYPE'           => 'INT',
              'FLD_KEY'            => 'on',
              'FLD_SIZE'           => '11',
              'FLD_NULL'           => '',
              'FLD_AUTO_INCREMENT' => 'on');
              array_unshift($aFields, $aUID); */
            $aTypes = array(
                'VARCHAR' => 'string',
                'TEXT'    => 'string',
                'DATE'    => 'int',
                'INT'     => 'int',
                'FLOAT'   => 'double'
            );
            $aCreoleTypes = array(
                'VARCHAR' => 'VARCHAR',
                'TEXT'    => 'LONGVARCHAR',
                'DATE'    => 'TIMESTAMP',
                'INT'     => 'INTEGER',
                'FLOAT'   => 'DOUBLE'
            );
            if ($sClassName == '') {
                $sClassName = $this->getPHPName($sTableName);
            }

            $sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
            if (!file_exists($sPath)) {
                G::mk_dir($sPath);
            }
            if (!file_exists($sPath . 'map')) {
                G::mk_dir($sPath . 'map');
            }
            if (!file_exists($sPath . 'om')) {
                G::mk_dir($sPath . 'om');
            }
            $aData = array();
            $aData['pathClasses'] = substr(PATH_DB, 0, -1);
            $aData['tableName'] = $sTableName;
            $aData['className'] = $sClassName;
            $aData['connection'] = $connection;
            $aData['GUID'] = $sAddTabUid;

            $aData['firstColumn'] = isset($aFields[0])
                                    ? strtoupper($aFields[0]['FLD_NAME'])
                                    : ($aFields[1]['FLD_NAME']);
            $aData['totalColumns'] = count($aFields);
            $aData['useIdGenerator'] = 'false';
            $oTP1 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'Table.tpl');
            $oTP1->prepare();
            $oTP1->assignGlobal($aData);
            file_put_contents($sPath . $sClassName . '.php', $oTP1->getOutputContent());
            $oTP2 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'TablePeer.tpl');
            $oTP2->prepare();
            $oTP2->assignGlobal($aData);
            file_put_contents($sPath . $sClassName . 'Peer.php', $oTP2->getOutputContent());
            $aColumns = array();
            $aPKs = array();
            $aNotPKs = array();
            $i = 0;
            foreach ($aFields as $iKey => $aField) {
                $aField['FLD_NAME'] = strtoupper($aField['FLD_NAME']);
                if ($aField['FLD_TYPE'] == 'DATE') {
                    $aField['FLD_NULL'] = '';
                }
                $aColumn = array(
                    'name' => $aField['FLD_NAME'],
                    'phpName' => $this->getPHPName($aField['FLD_NAME']),
                    'type' => $aTypes[$aField['FLD_TYPE']],
                    'creoleType' => $aCreoleTypes[$aField['FLD_TYPE']],
                    'notNull' => ($aField['FLD_NULL'] == 'on' ? 'true' : 'false'),
                    'size' => (($aField['FLD_TYPE'] == 'VARCHAR')
                              || ($aField['FLD_TYPE'] == 'INT')
                              || ($aField['FLD_TYPE'] == 'FLOAT') ? $aField['FLD_SIZE'] : 'null'),
                    'var' => strtolower($aField['FLD_NAME']),
                    'attribute' => (($aField['FLD_TYPE'] == 'VARCHAR')
                                   || ($aField['FLD_TYPE'] == 'TEXT')
                                   || ($aField['FLD_TYPE'] == 'DATE')
                                   ? '$' . strtolower($aField['FLD_NAME']) . " = ''"
                                   : '$' . strtolower($aField['FLD_NAME']) . ' = 0'),
                    'index' => $i,
                );
                if ($aField['FLD_TYPE'] == 'DATE') {
                    $aColumn['getFunction'] = '/**
   * Get the [optionally formatted] [' . $aColumn['var'] . '] column value.
   *
   * @param      string $format The date/time format string (either date()-style or strftime()-style).
   *              If format is NULL, then the integer unix timestamp will be returned.
   * @return     mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
   * @throws     PropelException - if unable to convert the date/time to timestamp.
   */
  public function get' . $aColumn['phpName'] . '($format = "Y-m-d")
  {

    if ($this->' . $aColumn['var'] . ' === null || $this->' . $aColumn['var'] . ' === "") {
      return null;
    } elseif (!is_int($this->' . $aColumn['var'] . ')) {
      // a non-timestamp value was set externally, so we convert it
      if (($this->' . $aColumn['var'] . ' == "0000-00-00 00:00:00")
           || ($this->' . $aColumn['var'] . ' == "0000-00-00") || !$this->' . $aColumn['var'] . ') {
        $ts = "0";
      }
      else {
        $ts = strtotime($this->' . $aColumn['var'] . ');
      }
      if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
        throw new PropelException("Unable to parse value of [' . $aColumn['var'] . '] as date/time value: "
                                 . var_export($this->' . $aColumn['var'] . ', true));
      }
    } else {
      $ts = $this->' . $aColumn['var'] . ';
    }
    if ($format === null) {
      return $ts;
    } elseif (strpos($format, "%") !== false) {
      return strftime($format, $ts);
    } else {
      return date($format, $ts);
    }
  }';
                } else {
                    $aColumn['getFunction'] = '/**
   * Get the [' . $aColumn['var'] . '] column value.
   *
   * @return     string
   */
  public function get' . $aColumn['phpName'] . '()
  {

    return $this->' . $aColumn['var'] . ';
  }';
                }
                switch ($aField['FLD_TYPE']) {
                    case 'VARCHAR':
                    case 'TEXT':
                        $aColumn['setFunction'] = '// Since the native PHP type for this column is string,
    // we will cast the input to a string (if it is not).
    if ($v !== null && !is_string($v)) {
      $v = (string) $v;
    }

    if ($this->' . $aColumn['var'] . ' !== $v) {
      $this->' . $aColumn['var'] . ' = $v;
      $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
    }';
                        break;
                    case 'DATE':
                        $aColumn['setFunction'] = 'if ($v !== null && !is_int($v)) {
      // if($v == \'\')
      //   $ts = null;
     // else
       $ts = strtotime($v);
     if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
       //throw new PropelException("Unable to parse date/time value for [' . $aColumn['var'] . '] from input: "
       //                          . var_export($v, true));
     }
   } else {
     $ts = $v;
   }
   if ($this->' . $aColumn['var'] . ' !== $ts) {
     $this->' . $aColumn['var'] . ' = $ts;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                    case 'INT':
                        $aColumn['setFunction'] = '// Since the native PHP type for this column is integer,
   // we will cast the input value to an int (if it is not).
   if ($v !== null && !is_int($v) && is_numeric($v)) {
     $v = (int) $v;
   }
   if ($this->' . $aColumn['var'] . ' !== $v || $v === 1) {
     $this->' . $aColumn['var'] . ' = $v;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                    case 'FLOAT':
                        $aColumn['setFunction'] = 'if ($this->' . $aColumn['var'] . ' !== $v || $v === 0) {
     $this->' . $aColumn['var'] . ' = $v;
     $this->modifiedColumns[] = ' . $aData['className'] . 'Peer::' . $aColumn['name'] . ';
   }';
                        break;
                }
                $aColumns[] = $aColumn;
                if ($aField['FLD_KEY'] == 1 || $aField['FLD_KEY'] === 'on') {
                    $aPKs[] = $aColumn;
                } else {
                    $aNotPKs[] = $aColumn;
                }
                if ($aField['FLD_AUTO_INCREMENT'] == 1 || $aField['FLD_AUTO_INCREMENT'] === 'on') {
                    $aData['useIdGenerator'] = 'true';
                }
                $i++;
            }
            $oTP3 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'map'
                                    . PATH_SEP . 'TableMapBuilder.tpl');
            $oTP3->prepare();
            $oTP3->assignGlobal($aData);
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP3->newBlock('primaryKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP3->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP3->gotoBlock('_ROOT');
            foreach ($aNotPKs as $iIndex => $aColumn) {
                $oTP3->newBlock('columnsWhitoutKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP3->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName
                           . 'MapBuilder.php', $oTP3->getOutputContent());
            $oTP4 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTable.tpl');
            $oTP4->prepare();
            switch (count($aPKs)) {
                case 0:
                    $aData['getPrimaryKeyFunction'] = 'return null;';
                    $aData['setPrimaryKeyFunction'] = '';
                    break;
                case 1:
                    $aData['getPrimaryKeyFunction'] = 'return $this->get' . $aPKs[0]['phpName'] . '();';
                    $aData['setPrimaryKeyFunction'] = '$this->set' . $aPKs[0]['phpName'] . '($key);';
                    break;
                default:
                    $aData['getPrimaryKeyFunction'] = '$pks = array();' . "\n";
                    $aData['setPrimaryKeyFunction'] = '';
                    foreach ($aPKs as $iIndex => $aColumn) {
                        $aData['getPrimaryKeyFunction'] .= '$pks[' . $iIndex . '] = $this->get'
                                                         . $aColumn['phpName'] . '();' . "\n";
                        $aData['setPrimaryKeyFunction'] .= '$this->set' . $aColumn['phpName']
                                                         . '($keys[' . $iIndex . ']);' . "\n";
                    }
                    $aData['getPrimaryKeyFunction'] .= 'return $pks;' . "\n";
                    break;
            }
            $oTP4->assignGlobal($aData);
            foreach ($aColumns as $iIndex => $aColumn) {
                $oTP4->newBlock('allColumns1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns3');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns4');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns5');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns6');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns7');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns8');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
                $oTP4->newBlock('allColumns9');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('primaryKeys1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('primaryKeys2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP4->gotoBlock('_ROOT');
            foreach ($aNotPKs as $iIndex => $aColumn) {
                $oTP4->newBlock('columnsWhitoutKeys');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP4->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
                            . $sClassName . '.php', $oTP4->getOutputContent());
            $oTP5 = new TemplatePower(PATH_TPL . 'additionalTables' . PATH_SEP . 'om' . PATH_SEP . 'BaseTablePeer.tpl');
            $oTP5->prepare();
            $sKeys = '';
            foreach ($aPKs as $iIndex => $aColumn) {
                $sKeys .= '$' . $aColumn['var'] . ', ';
            }
            $sKeys = substr($sKeys, 0, -2);
            //$sKeys = '$pm_unique_id';
            if ($sKeys != '') {
                $aData['sKeys'] = $sKeys;
            } else {
                $aData['sKeys'] = '$DUMMY';
            }
            $oTP5->assignGlobal($aData);
            foreach ($aColumns as $iIndex => $aColumn) {
                $oTP5->newBlock('allColumns1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns3');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns4');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns5');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns6');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns7');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns8');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns9');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
                $oTP5->newBlock('allColumns10');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            $oTP5->gotoBlock('_ROOT');
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP5->newBlock('primaryKeys1');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            foreach ($aPKs as $iIndex => $aColumn) {
                $oTP5->newBlock('primaryKeys2');
                $aKeys = array_keys($aColumn);
                foreach ($aKeys as $sKey) {
                    $oTP5->assign($sKey, $aColumn[$sKey]);
                }
            }
            file_put_contents($sPath . PATH_SEP . 'om' . PATH_SEP . 'Base'
                            . $sClassName . 'Peer.php', $oTP5->getOutputContent());
        } catch (Exception $oError) {
            throw($oError);
        }
    }
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 *
 */
$tpl = new TemplatePower(PATH_TPL . "cases" . PATH_SEP . "cases_DynaformHistory.html");
$tpl->prepare();
require_once 'classes/model/AppHistory.php';
G::LoadClass('case');
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
// Load form info
if (isset($_REQUEST['DYN_UID']) && $_REQUEST['DYN_UID'] != '') {
    $form = new Form($_REQUEST['PRO_UID'] . PATH_SEP . $_REQUEST['DYN_UID'], PATH_DYNAFORM, SYS_LANG, false);
}
$historyData = array();
$historyDataAux = array();
$appHistory = new AppHistory();
$c = $appHistory->getDynaformHistory($_REQUEST['PRO_UID'], $_REQUEST['TAS_UID'], $_REQUEST['APP_UID'], $_REQUEST['DYN_UID']);
$oDataset = ArrayBasePeer::doSelectRs($c);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
Example #21
0
<?php

$tpl = new TemplatePower('template/codigos/formaCodigo.tpl');
$tpl->prepare();
$objestados = new Estado($conn);
$objeventos = new Eventos($conn);
$objcodigo = new Codigos($conn);
$objasociado = new Asociados($conn);
$id_codigo = '';
if (!empty($_GET['id_codigo'])) {
    $id_codigo = $_GET['id_codigo'];
}
if ($id_codigo != '') {
    //Editar
    $tpl->assign("discodigo", "disabled='disabled'");
    $tpl->assign("id_codigo", $id_codigo);
    $objcodigo->setID($id_codigo);
    $codigo = $objcodigo->codigoByid();
    /*
    echo "<pre>";
        print_r($codigo);
    echo "</pre>";
    */
    $tpl->assign("pulsera", $codigo['codigo_pulsera']);
    $lista_eventos = $objeventos->listaEventos();
    foreach ($lista_eventos as $evento) {
        $tpl->newBlock("eventos");
        $tpl->assign("nombre", $evento['nombre']);
        $tpl->assign("id", $evento['id']);
        if ($evento['id'] == $codigo['id_evento']) {
            $tpl->assign("seleve", "selected='selected'");
Example #22
0
 function update($aData)
 {
     $oConnection = Propel::getConnection(EventPeer::DATABASE_NAME);
     try {
         $oEvent = EventPeer::retrieveByPK($aData['EVN_UID']);
         if (!is_null($oEvent)) {
             //$oEvent->setProUid( $aData['PRO_UID'] );
             if (isset($aData['EVN_RELATED_TO'])) {
                 $oEvent->setEvnRelatedTo($aData['EVN_RELATED_TO']);
                 if ($aData['EVN_RELATED_TO'] == 'SINGLE') {
                     if (isset($aData['TAS_UID']) && $aData['TAS_UID'] != '') {
                         $oEvent->setTasUid($aData['TAS_UID']);
                     }
                     $oEvent->setEvnTasUidTo('');
                     $oEvent->setEvnTasUidFrom('');
                 } else {
                     $oEvent->setTasUid('');
                     if (isset($aData['EVN_TAS_UID_TO'])) {
                         $oEvent->setEvnTasUidTo($aData['EVN_TAS_UID_TO']);
                     }
                     if (isset($aData['EVN_TAS_UID_FROM'])) {
                         $oEvent->setEvnTasUidFrom($aData['EVN_TAS_UID_FROM']);
                     }
                 }
             }
             if (isset($aData['EVN_POSX'])) {
                 $oEvent->setEvnPosx($aData['EVN_POSX']);
             }
             if (isset($aData['EVN_POSY'])) {
                 $oEvent->setEvnPosy($aData['EVN_POSY']);
             }
             if (isset($aData['EVN_TAS_ESTIMATED_DURATION'])) {
                 $oEvent->setEvnTasEstimatedDuration($aData['EVN_TAS_ESTIMATED_DURATION']);
             }
             if (isset($aData['EVN_WHEN_OCCURS'])) {
                 $oEvent->setEvnWhenOccurs($aData['EVN_WHEN_OCCURS']);
             }
             if (isset($aData['EVN_STATUS'])) {
                 $oEvent->setEvnStatus($aData['EVN_STATUS']);
             }
             if (isset($aData['EVN_WHEN'])) {
                 $oEvent->setEvnWhen($aData['EVN_WHEN']);
             }
             if (isset($aData['TRI_UID'])) {
                 $oEvent->setTriUid($aData['TRI_UID']);
             }
             if (isset($aData['EVN_TYPE'])) {
                 $oEvent->setEvnType($aData['EVN_TYPE']);
             }
             if (isset($aData['EVN_CONDITIONS'])) {
                 $oEvent->setEvnConditions($aData['EVN_CONDITIONS']);
             }
             if (isset($aData['EVN_ACTION'])) {
                 $oEvent->setEvnAction($aData['EVN_ACTION']);
             }
             //if ( isset ($aData['ENV_MAX_ATTEMPTS'] )) $oEvent->setEvnMaxAttempts( 3 );
             if (isset($aData['EVN_ACTION_PARAMETERS']) && $aData['EVN_ACTION_PARAMETERS'] != 0) {
                 $oTP = new TemplatePower(PATH_TPL . 'events' . PATH_SEP . 'sendMessage.tpl');
                 $oTP->prepare();
                 $oTP->assign('from', '*****@*****.**');
                 $oTP->assign('subject', addslashes($aData['EVN_ACTION_PARAMETERS']['SUBJECT']));
                 $oTP->assign('template', $aData['EVN_ACTION_PARAMETERS']['TEMPLATE']);
                 $oTP->assign('timestamp', date("l jS \\of F Y h:i:s A"));
                 $recipientTO = implode(',', $aData['EVN_ACTION_PARAMETERS']['TO']);
                 $recipientCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['CC']);
                 $recipientBCC = implode(',', $aData['EVN_ACTION_PARAMETERS']['BCC']);
                 $oTP->assign('TO', addslashes($recipientTO));
                 $oTP->assign('CC', addslashes($recipientCC));
                 $oTP->assign('BCC', addslashes($recipientBCC));
                 $sTrigger = $oTP->getOutputContent();
                 $oTrigger = new Triggers();
                 $aTrigger = $oTrigger->load($oEvent->getTriUid());
                 $aTrigger['TRI_WEBBOT'] = $sTrigger;
                 $oTrigger->update($aTrigger);
                 $oParameters = new StdClass();
                 $oParameters->hash = md5($sTrigger);
                 $oParameters->SUBJECT = $aData['EVN_ACTION_PARAMETERS']['SUBJECT'];
                 $oParameters->TO = $aData['EVN_ACTION_PARAMETERS']['TO'];
                 $oParameters->CC = $aData['EVN_ACTION_PARAMETERS']['CC'];
                 $oParameters->BCC = $aData['EVN_ACTION_PARAMETERS']['BCC'];
                 $oParameters->TEMPLATE = $aData['EVN_ACTION_PARAMETERS']['TEMPLATE'];
                 //$oParameters->TRI_UID  = $sTrigger->getTriUid();
                 $oEvent->setEvnActionParameters(serialize($oParameters));
             }
             if ($oEvent->validate()) {
                 //start the transaction
                 $oConnection->begin();
                 if (array_key_exists('EVN_DESCRIPTION', $aData)) {
                     $oEvent->setEvnDescription($aData['EVN_DESCRIPTION']);
                 }
                 $iResult = $oEvent->save();
                 $oConnection->commit();
                 return $iResult;
             } else {
                 $sMessage = '';
                 $aValidationFailures = $oEvent->getValidationFailures();
                 foreach ($aValidationFailures as $oValidationFailure) {
                     $sMessage .= $oValidationFailure->getMessage() . '<br />';
                 }
                 throw new Exception('The registry cannot be updated!<br />' . $sMessage);
             }
         } else {
             throw new Exception('This row doesn\'t exist!');
         }
     } catch (Exception $oError) {
         $oConnection->rollback();
         throw $oError;
     }
 }
Example #23
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
$G_PUBLISH = new Publisher();
$fileGetStart = PATH_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
if (!file_exists($fileGetStart)) {
    $fileGetStart = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
    if (!file_exists($fileGetStart)) {
        $fileGetStart = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'login_getStarted.html';
        if (!file_exists($fileGetStart)) {
            $fileGetStart = PATH_TPL . 'services/login_getStarted.html';
        }
    }
}
$oTemplatePower = new TemplatePower($fileGetStart);
$oTemplatePower->prepare();
/*
$oTemplatePower->newBlock('users');
$oTemplatePower->assign('USR_UID', $aUser['USR_UID']);
$oTemplatePower->assign('USR_FULLNAME', $aData['USR_FIRSTNAME'] . ' ' . $aData['USR_LASTNAME'] . ' (' . $aData['USR_USERNAME'] . ')');
*/
$oTemplatePower->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
G::RenderPage('publish', 'raw');
Example #24
0
 * @date Apr 5th, 2010
 */
if (($RBAC_Response = $RBAC->userCanAccess("PM_SETUP")) != 1) {
    return $RBAC_Response;
}
$G_MAIN_MENU = "processmaker";
$G_ID_MENU_SELECTED = "SETUP";
$G_PUBLISH = new Publisher();
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load('setup');
$toolItems = array();
foreach ($oMenu->Options as $i => $option) {
    $toolItems[] = array('id' => $oMenu->Id[$i], 'link' => $oMenu->Options[$i] != '' ? $oMenu->Options[$i] : '#', 'onclick' => $oMenu->JS[$i] != '' ? $oMenu->JS[$i] : '', 'label' => $oMenu->Labels[$i], 'icon' => $oMenu->Icons[$i] != '' ? $oMenu->Icons[$i] : 'icon-pmlogo.png', 'target' => $oMenu->JS[$i] != '' ? '' : 'admToolsContent');
}
$template = new TemplatePower(PATH_TPL . 'setup' . PATH_SEP . 'tools.html');
$template->prepare();
$template->assign('LeftWidth', '230');
$template->assign('contentHeight', '520');
if (isset($_GET['i18'])) {
    $_SESSION['TOOLS_VIEWTYPE'] = true;
    $template->assign('displayLanguageTool', 'block');
} else {
    $template->assign('displayLanguageTool', 'none');
}
if (isset($_GET['newSite'])) {
    $template->assign('displayNewSiteTool', 'block');
} else {
    $template->assign('displayNewSiteTool', 'none');
}
foreach ($toolItems as $item) {
<?php

$content = new TemplatePower("template/files/admin_comment.tpl");
$content->prepare();
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = NULL;
}
switch ($action) {
    case "toevoegen":
        if (!empty($_POST['username']) && !empty($_POST['Text'])) {
            // insert
            // insert
            $insert_comment = $db->prepare("INSERT INTO comments SET\n                  Username = :username,\n                  Text = :text,\n                  Accounts_idAccounts = :accountid");
            $insert_comment->bindParam(":username", $_POST['username']);
            $insert_comment->bindParam(":text", $_POST['Text']);
            $insert_comment->bindValue(":accountid", 4);
            $insert_comment->execute();
            $userid = $db->lastInsertId();
        } else {
            // formulier
            $content->newBlock("COMMENTFORM");
            $content->assign("ACTION", "index.php?pageid=10&action=toevoegen");
            $content->assign("BUTTON", "Toevoegen Comment");
        }
        break;
    case "wijzigen":
        if (isset($_POST['accountid'])) {
            $update_comment = $db->prepare("UPDATE comments\n                                          SET Text = :text\n                                          WHERE  idComments=:commentid");
            $update_comment->bindParam(":text", $_POST['Text']);
Example #26
0
<?php

//llamamos al constructor de la plantilla y la poreparamos para ser mostrada
$tplClave = new TemplatePower("plantilla/recuperar_clave.html");
$tplClave->prepare();
//primero comprobamos que el usuario NO este logeado, si esta logeado redirigimos a index.php
if (isset($_SESSION['logueado'])) {
    header("Location: index.php");
    exit;
}
if (isset($_GET['token'])) {
    $token = $_GET['token'];
    //en caso de que haya un token en la querystring gestionamos el proceso para nueva contraseƱa
    //debemos comprobar que el toquen sea valido, sino mostramos un mensaje de error
    $fecha = new DateTime(date("Y-m-d H:m:s"));
    $fecha->modify("-1 day");
    $query = "SELECT token, usuarios.usuario FROM usuarios_recuperar_clave, usuarios\n                WHERE token='{$token}' \n                AND fecha>'" . $fecha->format("Y-m-d H:m:s") . "'\n                AND usuarios_recuperar_clave.idusuario = usuarios.idusuario";
    $datos = mysql_fetch_assoc(mysql_query($query));
    if (!$datos) {
        //token invalido o no presente en la base de datos
        $tplClave->newBlock("errortoken");
        $tplClave->newBlock("generar_token");
    } else {
        //token valido
        $tplClave->newBlock("nueva_clave");
        //mostramos el usuario para el cual se va a asignar la nueva clave
        $tplClave->assign("user", $datos['usuario']);
        $tplClave->assign("token", $datos['token']);
    }
} else {
    //comprobamos si ha ocurrido un error durante la recepcion del formulario para generar el token
Example #27
0
<?php

$content = new TemplatePower("template/files/content.tpl");
$content->prepare();
Example #28
0
<?php

include 'tplutil.inc';
include 'class.TemplatePower.inc.php';
$tpl = new TemplatePower('presentations/slides/intro/templatepower.tpl');
$tpl->prepare();
$tpl->assign("TITLE", 'My Title');
$tpl->assign("USER", get_user());
foreach (get_users() as $user) {
    $tpl->newBlock('USERS');
    $tpl->assign('USER', $user);
}
$tpl->printToScreen();
<?php

$content = new TemplatePower("../html/registratie.tpl");
$content->prepare();
if (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = NULL;
}
switch ($action) {
    case "registreren":
        if (!empty($_POST['voornaam']) && !empty($_POST['achternaam']) && !empty($_POST['gebruikersnaam']) && !empty($_POST['email']) && !empty($_POST['password1']) && !empty($_POST['password2'])) {
            // insert
            if ($_POST['password1'] == $_POST['password2']) {
                // insert
                $insert_user = $db->prepare("INSERT INTO users SET\n                  Surename = :achternaam,\n                  Name = :voornaam,\n                  Email = :email");
                $insert_user->bindParam(":achternaam", $_POST['achternaam']);
                $insert_user->bindParam(":voornaam", $_POST['voornaam']);
                $insert_user->bindParam(":email", $_POST['email']);
                $insert_user->execute();
                $userid = $db->lastInsertId();
                $insert_account = $db->prepare("INSERT INTO accounts SET\n                  Username = :username,\n                  Password = :password,\n                  salt = :salt,\n                  Users_idUsers = :userid,\n                  Role_idRole = :roleid");
                $insert_account->bindParam(":username", $_POST['gebruikersnaam']);
                $password = sha1($_POST['password1']);
                $insert_account->bindParam(":password", $password);
                $insert_account->bindParam(":salt", $userid);
                $insert_account->bindParam(":userid", $userid);
                $insert_account->bindValue(":roleid", 1);
                $insert_account->execute();
                $content->newBlock("MELDING");
                $content->assign("MELDING", "Gebruiker is toegevoegd");
 public function consultarReserva()
 {
     $proteccion = new Proteccion();
     $cod_reserva = $proteccion->html($_POST['cod_reserva']);
     $reserva = new Reserva();
     $result = $reserva->BuscarReserva($cod_reserva);
     foreach ($result['result'] as $r) {
         $cod_reserva = $r['cod_reserva'];
     }
     $nom_hotel = $r['nom_hotel'];
     $nombre = $r['nombre'];
     $apellido = $r['apellido'];
     $email = $r['email'];
     $fec_llegada = $r['fec_llegada'];
     $fec_salida = $r['fec_salida'];
     $fec_reserva = $r['fec_reserva'];
     $piso = $r['piso'];
     $ubicacion = $r['ubicacion'];
     $tp = new TemplatePower("templates/reserva.html");
     $tp->prepare();
     $tp->gotoBlock("_ROOT");
     $tp->newBlock("generarreserva");
     $tp->assign("cod_reserva", $cod_reserva);
     $tp->assign("nom_hotel", $nom_hotel);
     $tp->assign("nombre", $nombre);
     $tp->assign("apellido", $apellido);
     $tp->assign("email", $email);
     $tp->assign("fec_llegada", $fec_llegada);
     $tp->assign("fec_salida", $fec_salida);
     $tp->assign("fec_reserva", $fec_reserva);
     $tp->assign("piso", $piso);
     $tp->assign("ubicacion", $ubicacion);
     echo $tp->getOutputContent();
 }