Example #1
0
 /**
  * getting default list
  *
  * @param string $httpData->PRO_UID (opional)
  */
 public function index($httpData)
 {
     global $RBAC;
     $RBAC->requirePermissions('PM_SETUP_ADVANCE');
     G::LoadClass('configuration');
     $c = new Configurations();
     $configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
     $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
     $this->includeExtJS('pmTables/list', $this->debug);
     $this->includeExtJS('pmTables/export', $this->debug);
     $this->setView('pmTables/list');
     //assigning js variables
     $this->setJSVar('FORMATS', $c->getFormats());
     $this->setJSVar('CONFIG', $Config);
     $this->setJSVar('PRO_UID', isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : false);
     $this->setJSVar('_PLUGIN_SIMPLEREPORTS', $this->_getSimpleReportPluginDef());
     if (isset($_SESSION['_cache_pmtables'])) {
         unset($_SESSION['_cache_pmtables']);
     }
     if (isset($_SESSION['ADD_TAB_UID'])) {
         unset($_SESSION['ADD_TAB_UID']);
     }
     //render content
     G::RenderPage('publish', 'extJs');
 }
Example #2
0
function updatePageSize()
{
    G::LoadClass('configuration');
    $c = new Configurations();
    $arr['pageSize'] = $_REQUEST['size'];
    $arr['dateSave'] = date('Y-m-d H:i:s');
    $config = array();
    $config[] = $arr;
    $c->aConfig = $config;
    $c->saveConfig('skinsList', 'pageSize', '', $_SESSION['USER_LOGGED']);
    echo '{success: true}';
}
Example #3
0
 /**
  * @param $config_file could be specified only the first time (due to option constructor of singleton)
  */
 public static function getStatusCodesConfiguration($config_file = '')
 {
     if (empty($config_file) && !file_exists($config_file)) {
         $config_file = SETUP_DIRECTORY . '/../config/status.sample.json';
     }
     return Configurations::getInstance()->getConfiguration(self::KEY_STATUS_CONFIGURATION, $config_file);
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Configurations the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Configurations::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #5
0
/**
 * departments_Ajax.php
 *
 * ProcessMaker Open Source Edition
 * Copyright (C) 2004 - 2008 Colosa Inc.23
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * 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.
 */
function LookForChildren($parent, $level, $aDepUsers)
{
    G::LoadClass('configuration');
    $conf = new Configurations();
    $oDept = new Department();
    $allDepartments = $oDept->getDepartments($parent);
    $level++;
    $rows = array();
    foreach ($allDepartments as $department) {
        unset($depto);
        $depto['DEP_TITLE'] = str_replace(array("<", ">"), array("&lt;", "&gt;"), $department['DEP_TITLE']);
        $depto['DEP_STATUS'] = $department['DEP_STATUS'];
        if ($department['DEP_MANAGER_USERNAME'] != '') {
            $depto['DEP_MANAGER_NAME'] = $conf->usersNameFormat($department['DEP_MANAGER_USERNAME'], $department['DEP_MANAGER_FIRSTNAME'], $department['DEP_MANAGER_LASTNAME']);
        } else {
            $depto['DEP_MANAGER_NAME'] = '';
        }
        $depto['DEP_TOTAL_USERS'] = isset($aDepUsers[$department['DEP_UID']]) ? $aDepUsers[$department['DEP_UID']] : 0;
        $depto['DEP_UID'] = $department['DEP_UID'];
        $depto['DEP_MANAGER'] = $department['DEP_MANAGER'];
        $depto['DEP_PARENT'] = $department['DEP_PARENT'];
        if ($department['HAS_CHILDREN'] > 0) {
            $depto['children'] = LookForChildren($department['DEP_UID'], $level, $aDepUsers);
            $depto['iconCls'] = 'ss_sprite ss_chart_organisation';
            $depto['expanded'] = true;
        } else {
            $depto['leaf'] = true;
            if ($level == 1) {
                $depto['iconCls'] = 'ss_sprite ss_chart_organisation';
            } else {
                $depto['iconCls'] = 'ss_sprite ss_plugin';
            }
        }
        $rows[] = $depto;
    }
    return $rows;
}
 /**
  * Sends an email with a link, for resetting the password.
  *
  * @return boolean whether the email was send
  */
 public function sendEmail()
 {
     /* @var $user User */
     $user = User::findOne(['status' => User::STATUS_ACTIVE, 'email' => $this->email]);
     if ($user) {
         if (!User::isPasswordResetTokenValid($user->password_reset_token)) {
             $user->generatePasswordResetToken();
         }
         if ($user->save()) {
             $admin_email = Configurations::find()->where(['key' => 'admin_email'])->one();
             return \Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user])->setFrom($admin_email->value)->setTo($this->email)->setSubject('Password reset for ' . \Yii::$app->name)->send();
         }
     }
     return false;
 }
 public function actionIndex()
 {
     //to hide welcome message - Rajith
     if (isset($_POST['hide'])) {
         //permanant hide
         if (isset($_POST['dontshow'])) {
             $config = Configurations::model()->findByAttributes(array('id' => 21));
             if ($config != NULL) {
                 $config->config_value = 1;
                 $config->save();
             }
         }
         $this->redirect(array('/mailbox'));
     }
     //check
     $config = Configurations::model()->findByAttributes(array('id' => 21));
     if ($config != NULL) {
         if ($config->config_value) {
             $this->redirect(array('/mailbox'));
         }
     }
     $this->render(Yii::app()->getModule('message')->viewPath . '/index');
 }
Example #8
0
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 */
if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
    G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
    //G::header('location: ../login/login');
    die;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
$G_PUBLISH = new Publisher();
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('skinList', 'pageSize', '', $_SESSION['USER_LOGGED']);
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('setup/skinList', false);
//adding a javascript file .js
$oHeadPublisher->addContent('setup/skinList');
//adding a html file  .html.
$oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign('SYS_SYS', "sys" . SYS_SYS);
$oHeadPublisher->assign('FORMATS', $c->getFormats());
G::RenderPage('publish', 'extJs');
die;
global $RBAC;
$access = $RBAC->userCanAccess('PM_SETUP');
 public function actionAjax_delete()
 {
     $id = $_POST['id'];
     $deleted = $this->loadModel($id);
     $deleted_batch_id = $deleted->batch_id;
     // Saving the id of the batch that is going to be deleted.
     if ($deleted->delete()) {
         //Adding activity to feed via saveFeed($initiator_id,$activity_type,$goal_id,$goal_name,$field_name,$initial_field_value,$new_field_value)
         ActivityFeed::model()->saveFeed(Yii::app()->user->Id, '13', $deleted_batch_id, ucfirst($deleted->name), NULL, NULL, NULL);
         // For SMS
         $sms_settings = SmsSettings::model()->findAll();
         $to = '';
         if ($sms_settings[0]->is_enabled == '1' and $sms_settings[5]->is_enabled == '1') {
             // Checking if SMS is enabled.
             $students = Students::model()->findAll("batch_id=:x", array(':x' => $deleted_batch_id));
             //Selecting students of the batch
             foreach ($students as $student) {
                 if ($student->phone1) {
                     // Checking if phone number is provided
                     $to = $student->phone1;
                 } elseif ($student->phone2) {
                     $to = $student->phone2;
                 }
                 if ($to != '') {
                     // Sending SMS to each student
                     $college = Configurations::model()->findByPk(1);
                     $from = $college->config_value;
                     $message = $deleted->name . ' is cancelled';
                     SmsSettings::model()->sendSms($to, $from, $message);
                 }
             }
         }
         // End For SMS
         // Delete Exam and exam score
         $exam = Exams::model()->findAllByAttributes(array('exam_group_id' => $id));
         //print_r($exam);
         foreach ($exam as $exam1) {
             $examscore = ExamScores::model()->findAllByAttributes(array('exam_id' => $exam1->id));
             foreach ($examscore as $examscore1) {
                 $examscore1->delete();
             }
             $exam1->delete();
         }
         // End Delete Exam and exam score
         echo json_encode(array('success' => true));
         exit;
     } else {
         echo json_encode(array('success' => false));
         exit;
     }
 }
Example #10
0
    /**
     * Get list All owners of dashboards
     *
     * @access public
     * @param array $options, Data for list
     * @return array
     *
     * @author Marco Antonio Nina <*****@*****.**>
     * @copyright Colosa - Bolivia
     */
    public function getOwnerByDasUid($options = array())
    {
        Validator::isArray($options, '$options');
        
        G::LoadClass("dashboards");
        $das_uid = isset( $options["das_uid"] ) ? $options["das_uid"] : "";
        $start = isset( $options["start"] ) ? $options["start"] : "0";
        $limit = isset( $options["limit"] ) ? $options["limit"] : "";
        $search = isset( $options["search"] ) ? $options["search"] : "";
        $paged = isset( $options["paged"] ) ? $options["paged"] : true;
        $type = "extjs";

        $start = (int)$start;
        $start = abs($start);
        if ($start != 0) {
            $start--;
        }
        $limit = (int)$limit;
        $limit = abs($limit);
        if ($limit == 0) {
            G::LoadClass("configuration");
            $conf = new \Configurations();
            $configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
            if (isset($configList['casesListRowNumber'])) {
                $limit = (int)$configList['casesListRowNumber'];
            } else {
                $limit = 25;
            }
        } else {
            $limit = (int)$limit;
        }

        $dashboards = new \Dashboards();
        $result = $dashboards->getOwnerByDasUid($das_uid, $start, $limit, $search);


        if ($paged == false) {
            $response = $result['data'];
        } else {
            $response['totalCount'] = $result['totalCount'];
            $response['start'] = $start+1;
            $response['limit'] = $limit;
            $response['search']   = $search;

            $response['owner'] = $result['data'];
        }
        return $response;
    }   
Example #11
0
     if ($aFields['AUTH_SOURCE_PROVIDER'] != 'ldap') {
         $G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/ldapSearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
     } else {
         if (file_exists(PATH_XMLFORM . 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'Edit.xml')) {
             $G_PUBLISH->AddContent('propeltable', 'pagedTableLdap', 'authSources/' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults', $oCriteria, ' ', array('Checkbox' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
         } else {
             $G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', array('MESSAGE' => 'File: ' . $aFields['AUTH_SOURCE_PROVIDER'] . 'SearchResults.xml' . ' doesn\'t exist.'));
         }
     }
     G::RenderPage('publish', 'raw');
     break;
 case 'authSourcesList':
     require_once PATH_RBAC . 'model/AuthenticationSource.php';
     global $RBAC;
     G::LoadClass('configuration');
     $co = new Configurations();
     $config = $co->getConfiguration('authSourcesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
     $limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
     $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;
     $limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : $limit_size;
     $filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
     $Criterias = $RBAC->getAuthenticationSources($start, $limit, $filter);
     $Dat = AuthenticationSourcePeer::doSelectRS($Criterias['COUNTER']);
     $Dat->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $Dat->next();
     $row = $Dat->getRow();
     $total_sources = $row['CNT'];
     $oDataset = AuthenticationSourcePeer::doSelectRS($Criterias['LIST']);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     global $RBAC;
     $auth = $RBAC->getAllUsersByAuthSource();
Example #12
0
 /**
  * Extract the structure version value from serializated table field and check it.
  * @return true if the version is bigger than 1
  */
 public function gotDirectoryStructureVer2()
 {
     G::LoadClass("configuration");
     $configuration = new Configurations();
     if (defined('SYS_SYS') && $configuration->exists("ENVIRONMENT_SETTINGS")) {
         return $configuration->getDirectoryStructureVer() > 1;
     }
     return false;
 }
Example #13
0
    /**

     * Get list for Cases

     *

     * @access public

     * @param array $dataList, Data for list

     * @return array

     *

     * @author Brayan Pereyra (Cochalo) <*****@*****.**>

     * @copyright Colosa - Bolivia

    */

    public function getList($listName = 'inbox', $dataList = array(), $total = false)

    {

        Validator::isArray($dataList, '$dataList');

        if (!isset($dataList["userId"])) {

            throw (new \Exception(\G::LoadTranslation("ID_USER_NOT_EXIST", array('userId',''))));

        } else {

            Validator::usrUid($dataList["userId"], "userId");

        }



        $userUid = $dataList["userId"];

        $filters["paged"]    = isset( $dataList["paged"] ) ? $dataList["paged"] : true;

        $filters['count']    = isset( $dataList['count'] ) ? $dataList['count'] : true;

        $filters["category"] = isset( $dataList["category"] ) ? $dataList["category"] : "";

        $filters["process"]  = isset( $dataList["process"] ) ? $dataList["process"] : "";

        $filters["search"]   = isset( $dataList["search"] ) ? $dataList["search"] : "";

        $filters["filter"]   = isset( $dataList["filter"] ) ? $dataList["filter"] : "";

        $filters["dateFrom"] = (!empty( $dataList["dateFrom"] )) ? substr( $dataList["dateFrom"], 0, 10 ) : "";

        $filters["dateTo"]   = (!empty( $dataList["dateTo"] )) ? substr( $dataList["dateTo"], 0, 10 ) : "";



        $filters["start"]    = isset( $dataList["start"] ) ? $dataList["start"] : "0";

        $filters["limit"]    = isset( $dataList["limit"] ) ? $dataList["limit"] : "25";

        $filters["sort"]     = isset( $dataList["sort"] ) ? $dataList["sort"] : "";

        $filters["dir"]      = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC";



        $filters["action"]   = isset( $dataList["action"] ) ? $dataList["action"] : "";



        // Select list

        switch ($listName) {

            case 'inbox':

                $list = new \ListInbox();

                $listpeer = 'ListInboxPeer';

                break;

            case 'participated_history':

                $list = new \ListParticipatedHistory();

                $listpeer = 'ListParticipatedHistoryPeer';

                break;

            case 'participated_last':

                $list = new \ListParticipatedLast();

                $listpeer = 'ListParticipatedLastPeer';

                break;

            case 'completed':

                $list = new \ListCompleted();

                $listpeer = 'ListCompletedPeer';

                break;

            case 'paused':

                $list = new \ListPaused();

                $listpeer = 'ListPausedPeer';

                break;

            case 'canceled':

                $list = new \ListCanceled();

                $listpeer = 'ListCanceledPeer';

                break;

            case 'my_inbox':

                $list = new \ListMyInbox();

                $listpeer = 'ListMyInboxPeer';

                break;

            case 'unassigned':

                $list = new \ListUnassigned();

                $listpeer = 'ListUnassignedPeer';

                break;

        }





        // Validate filters

        $filters["start"] = (int)$filters["start"];

        $filters["start"] = abs($filters["start"]);

        if ($filters["start"] != 0) {

            $filters["start"]+1;

        }



        $filters["limit"] = (int)$filters["limit"];

        $filters["limit"] = abs($filters["limit"]);

        if ($filters["limit"] == 0) {

            G::LoadClass("configuration");

            $conf = new \Configurations();

            $generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');

            if (isset($generalConfCasesList['casesListRowNumber'])) {

                $filters["limit"] = (int)$generalConfCasesList['casesListRowNumber'];

            } else {

                $filters["limit"] = 25;

            }

        } else {

            $filters["limit"] = (int)$filters["limit"];

        }



        $filters["sort"] = G::toUpper($filters["sort"]);

        $columnsList = $listpeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);

        if (!(in_array($filters["sort"], $columnsList))) {

            $filters["sort"] = '';

        }



        $filters["dir"] = G::toUpper($filters["dir"]);

        if (!($filters["dir"] == 'DESC' || $filters["dir"] == 'ASC')) {

            $filters["dir"] = 'DESC';

        }

        if ($filters["process"] != '') {

            Validator::proUid($filters["process"], '$pro_uid');

        }

        if ($filters["category"] != '') {

            Validator::catUid($filters["category"], '$cat_uid');

        }

        if ($filters["dateFrom"] != '') {

            Validator::isDate($filters["dateFrom"], 'Y-m-d', '$date_from');

        }

        if ($filters["dateTo"] != '') {

            Validator::isDate($filters["dateTo"], 'Y-m-d', '$date_to');

        }



        if ($total) {

            $total = $list->countTotal($userUid, $filters);

            return $total;

        }



        $result = $list->loadList($userUid, $filters);

        if (!empty($result)) {

            foreach ($result as &$value) {

                if (isset($value['DEL_PREVIOUS_USR_UID'])) {

                    $value['PREVIOUS_USR_UID']       = $value['DEL_PREVIOUS_USR_UID'];

                    $value['PREVIOUS_USR_USERNAME']  = $value['DEL_PREVIOUS_USR_USERNAME'];

                    $value['PREVIOUS_USR_FIRSTNAME'] = $value['DEL_PREVIOUS_USR_FIRSTNAME'];

                    $value['PREVIOUS_USR_LASTNAME']  = $value['DEL_PREVIOUS_USR_LASTNAME'];

                }

                if (isset($value['DEL_DUE_DATE'])) {

                    $value['DEL_TASK_DUE_DATE'] = $value['DEL_DUE_DATE'];

                }

                if (isset($value['APP_PAUSED_DATE'])) {

                    $value['APP_UPDATE_DATE']   = $value['APP_PAUSED_DATE'];

                }

                if (isset($value['DEL_CURRENT_USR_USERNAME'])) {

                    $value['USR_USERNAME']      = $value['DEL_CURRENT_USR_USERNAME'];

                    $value['USR_FIRSTNAME']     = $value['DEL_CURRENT_USR_FIRSTNAME'];

                    $value['USR_LASTNAME']      = $value['DEL_CURRENT_USR_LASTNAME'];

                    $value['APP_UPDATE_DATE']   = $value['DEL_DELEGATE_DATE'];

                }

                if (isset($value['APP_STATUS'])) {

                    $value['APP_STATUS_LABEL']  = G::LoadTranslation( "ID_{$value['APP_STATUS']}" );

                }





                //$value = array_change_key_case($value, CASE_LOWER);

            }

        }

        $response = array();

        if ($filters["paged"]) {

            $filtersData = array();

            $filtersData['start']       = $filters["start"];

            $filtersData['limit']       = $filters["limit"];

            $filtersData['sort']        = G::toLower($filters["sort"]);

            $filtersData['dir']         = G::toLower($filters["dir"]);

            $filtersData['cat_uid']     = $filters["category"];

            $filtersData['pro_uid']     = $filters["process"];

            $filtersData['search']      = $filters["search"];

            $filtersData['date_from']   = $filters["dateFrom"];

            $filtersData['date_to']     = $filters["dateTo"];

            $response['filters']        = $filtersData;

            $response['data']           = $result;

            $filtersData['action']      = $filters["action"];

            $response['totalCount']     = $list->countTotal($userUid, $filtersData);

        } else {

            $response = $result;

        }

        return $response;

    }
Example #14
0
 public function getAllProcesses($start, $limit, $category = null, $processName = null, $counters = true, $reviewSubProcess = false, $userLogged = "")
 {
     require_once PATH_RBAC . "model/RbacUsers.php";
     require_once "classes/model/ProcessCategory.php";
     require_once "classes/model/Users.php";
     $user = new RbacUsers();
     $aProcesses = array();
     $categories = array();
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_PARENT);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_STATUS);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_CATEGORY);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_UPDATE_DATE);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_DATE);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_CREATE_USER);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_DEBUG);
     $oCriteria->addSelectColumn(ProcessPeer::PRO_TYPE_PROCESS);
     $oCriteria->addSelectColumn(UsersPeer::USR_UID);
     $oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
     $oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_UID);
     $oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
     $oCriteria->add(ProcessPeer::PRO_UID, '', Criteria::NOT_EQUAL);
     $oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
     if ($reviewSubProcess) {
         $oCriteria->add(ProcessPeer::PRO_SUBPROCESS, '1', Criteria::NOT_EQUAL);
     }
     if (isset($category)) {
         $oCriteria->add(ProcessPeer::PRO_CATEGORY, $category, Criteria::EQUAL);
     }
     $oCriteria->addJoin(ProcessPeer::PRO_CREATE_USER, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
     $oCriteria->addJoin(ProcessPeer::PRO_CATEGORY, ProcessCategoryPeer::CATEGORY_UID, Criteria::LEFT_JOIN);
     if ($this->sort == "PRO_CREATE_DATE") {
         if ($this->dir == "DESC") {
             $oCriteria->addDescendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
         } else {
             $oCriteria->addAscendingOrderByColumn(ProcessPeer::PRO_CREATE_DATE);
         }
     }
     if ($userLogged != "") {
         $oCriteria->add($oCriteria->getNewCriterion(ProcessPeer::PRO_TYPE_PROCESS, "PUBLIC", Criteria::EQUAL)->addOr($oCriteria->getNewCriterion(ProcessPeer::PRO_CREATE_USER, $userLogged, Criteria::EQUAL)));
     }
     $this->tmpCriteria = clone $oCriteria;
     //execute a query to obtain numbers, how many cases there are by process
     if ($counters) {
         $casesCnt = $this->getCasesCountInAllProcesses();
     }
     // getting bpmn projects
     $c = new Criteria('workflow');
     $c->addSelectColumn(BpmnProjectPeer::PRJ_UID);
     $ds = ProcessPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
     $ds->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $bpmnProjects = array();
     while ($ds->next()) {
         $row = $ds->getRow();
         $bpmnProjects[] = $row['PRJ_UID'];
     }
     //execute the query
     $oDataset = ProcessPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $processes = array();
     $uids = array();
     while ($oDataset->next()) {
         $row = $oDataset->getRow();
         $row["PROJECT_TYPE"] = $row["PRO_TYPE"] == "NORMAL" ? in_array($row["PRO_UID"], $bpmnProjects) ? "bpmn" : "classic" : $row["PRO_TYPE"];
         $processes[] = $row;
         $uids[] = $processes[sizeof($processes) - 1]['PRO_UID'];
     }
     //process details will have the info about the processes
     $processesDetails = array();
     //now get the labels for all process, using an array of Uids,
     $c = new Criteria('workflow');
     //$c->add ( ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL );
     $c->add(ContentPeer::CON_LANG, defined('SYS_LANG') ? SYS_LANG : 'en', Criteria::EQUAL);
     $c->add(ContentPeer::CON_ID, $uids, Criteria::IN);
     $dt = ContentPeer::doSelectRS($c, Propel::getDbConnection('workflow_ro'));
     $dt->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     while ($dt->next()) {
         $row = $dt->getRow();
         $processesDetails[$row['CON_ID']][$row['CON_CATEGORY']] = $row['CON_VALUE'];
     }
     G::loadClass('configuration');
     $oConf = new Configurations();
     $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
     foreach ($processes as $process) {
         $proTitle = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_TITLE']) ? $processesDetails[$process['PRO_UID']]['PRO_TITLE'] : '';
         $proDescription = isset($processesDetails[$process['PRO_UID']]) && isset($processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION']) ? $processesDetails[$process['PRO_UID']]['PRO_DESCRIPTION'] : '';
         $process["PRO_TYPE_PROCESS"] = $process["PRO_TYPE_PROCESS"] == "PUBLIC" ? G::LoadTranslation("ID_PUBLIC") : G::LoadTranslation("ID_PRIVATE");
         // verify if the title is already set on the current language
         if (trim($proTitle) == '') {
             // if not, then load the record to generate content for current language
             $proData = $this->load($process['PRO_UID']);
             $proTitle = $proData['PRO_TITLE'];
             $proDescription = $proData['PRO_DESCRIPTION'];
         }
         //filtering by $processName
         if (isset($processName) && $processName != '' && stripos($proTitle, $processName) === false) {
             continue;
         }
         if ($counters) {
             $casesCountTotal = 0;
             if (isset($casesCnt[$process['PRO_UID']])) {
                 foreach ($casesCnt[$process['PRO_UID']] as $item) {
                     $casesCountTotal += $item;
                 }
             }
         }
         //get user format from configuration
         $userOwner = isset($oConf->aConfig['format']) ? $oConf->aConfig['format'] : '';
         $creationDateMask = isset($oConf->aConfig['dateFormat']) ? $oConf->aConfig['dateFormat'] : '';
         if ($userOwner != '') {
             $userOwner = str_replace('@userName', $process['USR_USERNAME'], $userOwner);
             $userOwner = str_replace('@firstName', $process['USR_FIRSTNAME'], $userOwner);
             $userOwner = str_replace('@lastName', $process['USR_LASTNAME'], $userOwner);
             if ($userOwner == " ( )") {
                 $userOwner = '-';
             }
         } else {
             $userOwner = $process['USR_FIRSTNAME'] . ' ' . $process['USR_LASTNAME'];
         }
         //get date format from configuration
         if ($creationDateMask != '') {
             list($date, $time) = explode(' ', $process['PRO_CREATE_DATE']);
             list($y, $m, $d) = explode('-', $date);
             list($h, $i, $s) = explode(':', $time);
             $process['PRO_CREATE_DATE'] = date($creationDateMask, mktime($h, $i, $s, $m, $d, $y));
         }
         $process['PRO_CATEGORY_LABEL'] = trim($process['PRO_CATEGORY']) != '' ? $process['CATEGORY_NAME'] : '- ' . G::LoadTranslation('ID_PROCESS_NO_CATEGORY') . ' -';
         $process['PRO_TITLE'] = $proTitle;
         $process['PRO_DESCRIPTION'] = $proDescription;
         $process['PRO_DEBUG'] = $process['PRO_DEBUG'];
         $process['PRO_DEBUG_LABEL'] = $process['PRO_DEBUG'] == "1" ? G::LoadTranslation('ID_ON') : G::LoadTranslation('ID_OFF');
         $process['PRO_STATUS_LABEL'] = $process['PRO_STATUS'] == 'ACTIVE' ? G::LoadTranslation('ID_ACTIVE') : G::LoadTranslation('ID_INACTIVE');
         $process['PRO_CREATE_USER_LABEL'] = $userOwner;
         if ($counters) {
             $process['CASES_COUNT_TO_DO'] = isset($casesCnt[$process['PRO_UID']]['TO_DO']) ? $casesCnt[$process['PRO_UID']]['TO_DO'] : 0;
             $process['CASES_COUNT_COMPLETED'] = isset($casesCnt[$process['PRO_UID']]['COMPLETED']) ? $casesCnt[$process['PRO_UID']]['COMPLETED'] : 0;
             $process['CASES_COUNT_DRAFT'] = isset($casesCnt[$process['PRO_UID']]['DRAFT']) ? $casesCnt[$process['PRO_UID']]['DRAFT'] : 0;
             $process['CASES_COUNT_CANCELLED'] = isset($casesCnt[$process['PRO_UID']]['CANCELLED']) ? $casesCnt[$process['PRO_UID']]['CANCELLED'] : 0;
             $process['CASES_COUNT'] = $casesCountTotal;
         }
         unset($process['PRO_CREATE_USER']);
         $aProcesses[] = $process;
     }
     $memcache =& PMmemcached::getSingleton(SYS_SYS);
     if (isset($memcache) && $memcache->enabled == 1) {
         return $aProcesses;
     }
     if ($limit == '') {
         $limit = count($aProcesses);
     }
     if ($this->sort != "PRO_CREATE_DATE") {
         if ($this->dir == "ASC") {
             usort($aProcesses, array($this, "ordProcessAsc"));
         } else {
             usort($aProcesses, array($this, "ordProcessDesc"));
         }
     }
     return $aProcesses;
 }
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Guardians();
     $check_flag = 0;
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if ($_POST['student_id']) {
         $guardian = Students::model()->findByAttributes(array('id' => $_POST['student_id']));
         $gid = $guardian->parent_id;
     } elseif ($_POST['guardian_id']) {
         $gid = $_POST['guardian_id'];
     } elseif ($_POST['guardian_mail']) {
         $gid = $_POST['guardian_mail'];
     }
     if ($gid != NULL and $gid != 0) {
         $model = Guardians::model()->findByAttributes(array('id' => $gid));
         $this->render('create', array('model' => $model, 'radio_flag' => 1, 'guardian_id' => $gid));
     } elseif ((isset($_POST['student_id']) or isset($_POST['guardian_id']) or isset($_POST['guardian_mail'])) and ($gid == NULL or $gid == 0)) {
         Yii::app()->user->setFlash('errorMessage', UserModule::t("Guardian not found..!"));
     }
     if (isset($_POST['Guardians'])) {
         $model->attributes = $_POST['Guardians'];
         $model->validate();
         if ($_POST['Guardians']['user_create'] == 1) {
             $check_flag = 1;
         }
         //print_r($_POST['Guardians']); exit;
         if ($model->save()) {
             //echo $model->ward_id; exit;
             $student = Students::model()->findByAttributes(array('id' => $model->ward_id));
             $student->saveAttributes(array('parent_id' => $model->id));
             if ($_POST['Guardians']['user_create'] == 0) {
                 //adding user for current guardian
                 $user = new User();
                 $profile = new Profile();
                 $user->username = substr(md5(uniqid(mt_rand(), true)), 0, 10);
                 $user->email = $model->email;
                 $user->activkey = UserModule::encrypting(microtime() . $model->first_name);
                 $password = substr(md5(uniqid(mt_rand(), true)), 0, 10);
                 $user->password = UserModule::encrypting($password);
                 $user->superuser = 0;
                 $user->status = 1;
                 if ($user->save()) {
                     //assign role
                     $authorizer = Yii::app()->getModule("rights")->getAuthorizer();
                     $authorizer->authManager->assign('parent', $user->id);
                     //profile
                     $profile->firstname = $model->first_name;
                     $profile->lastname = $model->last_name;
                     $profile->user_id = $user->id;
                     $profile->save();
                     //saving user id to guardian table.
                     $model->saveAttributes(array('uid' => $user->id));
                     //$model->uid = $user->id;
                     //$model->save();
                     // for sending sms
                     $sms_settings = SmsSettings::model()->findAll();
                     $to = '';
                     if ($sms_settings[0]->is_enabled == '1' and $sms_settings[2]->is_enabled == '1') {
                         // Checking if SMS is enabled.
                         if ($model->mobile_phone) {
                             $to = $model->mobile_phone;
                         }
                         if ($to != '') {
                             // Send SMS if phone number is provided
                             $college = Configurations::model()->findByPk(1);
                             $from = $college->config_value;
                             $message = 'Welcome to ' . $college->config_value;
                             SmsSettings::model()->sendSms($to, $from, $message);
                         }
                         // End send SMS
                     }
                     // End check if SMS is enabled
                     UserModule::sendMail($model->email, UserModule::t("You registered from {site_name}", array('{site_name}' => Yii::app()->name)), UserModule::t("Please login to your account with your email id as username and password {password}", array('{password}' => $password)));
                 }
             }
             $this->redirect(array('addguardian', 'id' => $model->ward_id));
         }
     }
     $this->render('create', array('model' => $model, 'check_flag' => $check_flag));
 }
Example #16
0
        $_GET['DEL_INDEX'] = $oCase->getCurrentDelegation($_GET['APP_UID'], $_SESSION['USER_LOGGED']);
        if (is_null($_GET['APP_UID'])) {
            throw new Exception(G::LoadTranslation('ID_CASE_DOES_NOT_EXISTS'));
        }
        if (is_null($_GET['DEL_INDEX'])) {
            throw new Exception(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER'));
        }
    } else {
        throw new Exception("Application ID or Delegation Index is missing!. The System can't open the case.");
    }
}
require_once "classes/model/Step.php";
G::LoadClass("configuration");
G::LoadClass("case");
$oCase = new Cases();
$conf = new Configurations();
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript('app/main', true);
$oHeadPublisher->addExtJsScript('cases/open', true);
$oHeadPublisher->assign('FORMATS', $conf->getFormats());
$uri = '';
foreach ($_GET as $k => $v) {
    $uri .= $uri == '' ? "{$k}={$v}" : "&{$k}={$v}";
}
//$case = $oCase->loadCase( $_GET['APP_UID'], $_GET['DEL_INDEX'] );
if (isset($_GET['action']) && $_GET['action'] == 'jump') {
    $case = $oCase->loadCase($_GET['APP_UID'], $_GET['DEL_INDEX'], $_GET['action']);
} else {
    $case = $oCase->loadCase($_GET['APP_UID'], $_GET['DEL_INDEX']);
}
if (!isset($_GET['to_revise'])) {
Example #17
0
                        <?php 
 $logo = Logo::model()->findAll();
 ?>
                         <?php 
 if ($logo != NULL) {
     //Yii::app()->runController('Configurations/displayLogoImage/id/'.$logo[0]->primaryKey);
     echo '<img src="uploadedfiles/school_logo/' . $logo[0]->photo_file_name . '" alt="' . $logo[0]->photo_file_name . '" class="imgbrder" width="100%" />';
 }
 ?>
             </td>
             <td align="center" valign="middle" class="first" style="width:300px;">
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                     <tr>
                         <td class="listbxtop_hdng first" style="text-align:left; font-size:22px; width:300px;  padding-left:10px;">
                             <?php 
 $college = Configurations::model()->findAll();
 ?>
                             <?php 
 echo $college[0]->config_value;
 ?>
                         </td>
                     </tr>
                     <tr>
                         <td class="listbxtop_hdng first" style="text-align:left; font-size:14px; padding-left:10px;">
                             <?php 
 echo $college[1]->config_value;
 ?>
                         </td>
                     </tr>
                     <tr>
                         <td class="listbxtop_hdng first" style="text-align:left; font-size:14px; padding-left:10px;">
/**
 * loads the PM Table field list from the database based in an action parameter
 * then assemble the List of fields with these data, for the configuration in cases list.
 *
 * @param String $action
 * @return Array $config
 *
 */
function getAdditionalFields($action, $confCasesList = array())
{
    $config = new Configurations();
    $arrayConfig = $config->casesListDefaultFieldsAndConfig($action);
    if (is_array($confCasesList) && count($confCasesList) > 0 && count($confCasesList["second"]["data"]) > 0) {
        //For the case list builder in the enterprise plugin
        $caseColumns = array();
        $caseReaderFields = array();
        $caseReaderFieldsAux = array();
        foreach ($confCasesList["second"]["data"] as $index1 => $value1) {
            $arrayField = $value1;
            if ($arrayField["fieldType"] != "key") {
                $arrayAux = array();
                foreach ($arrayField as $index2 => $value2) {
                    if ($index2 != "gridIndex" && $index2 != "fieldType") {
                        $indexAux = $index2;
                        $valueAux = $value2;
                        switch ($index2) {
                            case "name":
                                $indexAux = "dataIndex";
                                break;
                            case "label":
                                $indexAux = "header";
                                if (preg_match("/^\\*\\*(.+)\\*\\*\$/", $value2, $arrayMatch)) {
                                    $valueAux = G::LoadTranslation($arrayMatch[1]);
                                }
                                break;
                        }
                        $arrayAux[$indexAux] = $valueAux;
                    }
                }
                $caseColumns[] = $arrayAux;
                $caseReaderFields[] = array("name" => $arrayField["name"]);
                $caseReaderFieldsAux[] = $arrayField["name"];
            }
        }
        foreach ($arrayConfig["caseReaderFields"] as $index => $value) {
            if (!in_array($value["name"], $caseReaderFieldsAux)) {
                $caseReaderFields[] = $value;
            }
        }
        $arrayConfig = array("caseColumns" => $caseColumns, "caseReaderFields" => $caseReaderFields, "rowsperpage" => $confCasesList["rowsperpage"], "dateformat" => $confCasesList["dateformat"]);
    }
    return $arrayConfig;
}
Example #19
0
} else {
    global $RBAC;
    switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE')) {
        case -2:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
        case -3:
        case -1:
            G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
            G::header('location: ../login/login');
            die;
            break;
    }
    $G_PUBLISH = new Publisher();
    G::LoadClass('configuration');
    $c = new Configurations();
    $configPage = $c->getConfiguration('usersList', 'pageSize', '', $_SESSION['USER_LOGGED']);
    $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
    $oHeadPublisher =& headPublisher::getSingleton();
    $oHeadPublisher->addExtJsScript('setup/newSite', false);
    //adding a javascript file .js
    $oHeadPublisher->addContent('setup/newSite');
    //adding a html file  .html.
    //  $oHeadPublisher->assign('CONFIG', $Config);
    //  $oHeadPublisher->assign('FORMATS',$c->getFormats());
    $oHeadPublisher->assign("SYS_LANG", SYS_LANG);
    $oHeadPublisher->assign("SYS_SKIN", SYS_SKIN);
    G::RenderPage('publish', 'extJs');
}
Example #20
0


global $_DBArray;

$_DBArray ['langOptions'] = $availableLangArray;



G::LoadClass('configuration');

//BootStrap::LoadClass('configuration');



$oConf = new Configurations();

$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');



$myUrl = explode("/", $_SERVER["REQUEST_URI"]);



if (isset($myUrl) && $myUrl != "") {

    $aFields["USER_LANG"] = $myUrl[2];

} else {
Example #21
0
 /**
  * get pm tables data
  *
  * @param string $httpData->id
  * @param string $httpData->start
  * @param string $httpData->limit
  */
 public function dataView($httpData)
 {
     require_once 'classes/model/AdditionalTables.php';
     G::LoadClass('configuration');
     $co = new Configurations();
     $config = $co->getConfiguration('additionalTablesData', 'pageSize', '', $_SESSION['USER_LOGGED']);
     $limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
     $start = isset($httpData->start) ? $httpData->start : 0;
     $limit = isset($httpData->limit) ? $httpData->limit : $limit_size;
     $additionalTables = new AdditionalTables();
     $table = $additionalTables->load($httpData->id, true);
     $result = $additionalTables->getAllData($httpData->id, $start, $limit);
     $primaryKeys = $additionalTables->getPrimaryKeys();
     foreach ($result['rows'] as $i => $row) {
         $primaryKeysValues = array();
         foreach ($primaryKeys as $key) {
             $primaryKeysValues[] = isset($row[$key['FLD_NAME']]) ? $row[$key['FLD_NAME']] : '';
         }
         $result['rows'][$i]['__index__'] = G::encrypt(implode(',', $primaryKeysValues), 'pmtable');
     }
     return $result;
 }
Example #22
0
 /**
  * Update properties of an Task
  * @var string $prj_uid. Uid for Process
  * @var string $act_uid. Uid for Activity
  * @var array $arrayProperty. Data for properties of Activity
  *
  * @author Brayan Pereyra (Cochalo) <*****@*****.**>
  * @copyright Colosa - Bolivia
  *
  * return object
  */
 public function updateProperties($prj_uid, $act_uid, $arrayProperty)
 {
     //Copy of processmaker/workflow/engine/methods/tasks/tasks_Ajax.php //case "saveTaskData":
     try {
         if (isset($arrayProperty['properties'])) {
             $arrayProperty = array_change_key_case($arrayProperty['properties'], CASE_UPPER);
         }
         $prj_uid = $this->validateProUid($prj_uid);
         $act_uid = $this->validateActUid($act_uid);
         $arrayProperty["TAS_UID"] = $act_uid;
         $arrayProperty["PRO_UID"] = $prj_uid;
         $task = new \Task();
         $aTaskInfo = $task->load($arrayProperty["TAS_UID"]);
         $bpmnActivity = \BpmnActivityPeer::retrieveByPK($act_uid);
         $arrayResult = array();
         if ($arrayProperty["TAS_SELFSERVICE_TIMEOUT"] == "1") {
             if (!is_numeric($arrayProperty["TAS_SELFSERVICE_TIME"]) || $arrayProperty["TAS_SELFSERVICE_TIME"] == '') {
                 throw new \Exception("Invalid value specified for 'tas_selfservice_time'");
             }
         }
         foreach ($arrayProperty as $k => $v) {
             $arrayProperty[$k] = str_replace("@amp@", "&", $v);
         }
         if (isset($arrayProperty["TAS_SEND_LAST_EMAIL"])) {
             $arrayProperty["TAS_SEND_LAST_EMAIL"] = $arrayProperty["TAS_SEND_LAST_EMAIL"] == "TRUE" ? "TRUE" : "FALSE";
         } else {
             if (isset($arrayProperty["SEND_EMAIL"])) {
                 $arrayProperty["TAS_SEND_LAST_EMAIL"] = $arrayProperty["SEND_EMAIL"] == "TRUE" ? "TRUE" : "FALSE";
             } else {
                 $arrayProperty["TAS_SEND_LAST_EMAIL"] = is_null($aTaskInfo["TAS_SEND_LAST_EMAIL"]) ? "FALSE" : $aTaskInfo["TAS_SEND_LAST_EMAIL"];
             }
         }
         //Validating TAS_ASSIGN_VARIABLE value
         if (!isset($arrayProperty["TAS_ASSIGN_TYPE"])) {
             $derivateType = $task->kgetassigType($arrayProperty["PRO_UID"], $arrayProperty["TAS_UID"]);
             if (is_null($derivateType)) {
                 $arrayProperty["TAS_ASSIGN_TYPE"] = "BALANCED";
             } else {
                 $arrayProperty["TAS_ASSIGN_TYPE"] = $derivateType["TAS_ASSIGN_TYPE"];
             }
         }
         $flagTaskIsMultipleInstance = $bpmnActivity->getActType() == "TASK" && preg_match("/^(?:EMPTY|USERTASK|MANUALTASK)\$/", $bpmnActivity->getActTaskType()) && $bpmnActivity->getActLoopType() == "PARALLEL";
         $flagTaskAssignTypeIsMultipleInstance = preg_match("/^(?:MULTIPLE_INSTANCE|MULTIPLE_INSTANCE_VALUE_BASED)\$/", $arrayProperty["TAS_ASSIGN_TYPE"]);
         if ($flagTaskIsMultipleInstance && !$flagTaskAssignTypeIsMultipleInstance) {
             $arrayProperty["TAS_ASSIGN_TYPE"] = "MULTIPLE_INSTANCE";
             $flagTaskAssignTypeIsMultipleInstance = true;
         }
         if ($flagTaskIsMultipleInstance && !$flagTaskAssignTypeIsMultipleInstance) {
             throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_INVALID_ASSIGNMENT_METHOD_FOR_MULTIPLE_INSTANCE_ACTIVITY", array(strtolower("ACT_UID"), $act_uid)));
         }
         if (!$flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance) {
             $arrayProperty["TAS_ASSIGN_TYPE"] = "BALANCED";
             $flagTaskAssignTypeIsMultipleInstance = false;
         }
         if (!$flagTaskIsMultipleInstance && $flagTaskAssignTypeIsMultipleInstance) {
             throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_INVALID_ASSIGNMENT_METHOD_FOR_ACTIVITY", array(strtolower("ACT_UID"), $act_uid)));
         }
         switch ($arrayProperty["TAS_ASSIGN_TYPE"]) {
             case 'BALANCED':
             case 'MANUAL':
             case 'REPORT_TO':
                 $this->unsetVar($arrayProperty, "TAS_ASSIGN_VARIABLE");
                 $this->unsetVar($arrayProperty, "TAS_GROUP_VARIABLE");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIMEOUT");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME_UNIT");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TRIGGER_UID");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_EXECUTION");
                 break;
             case 'EVALUATE':
                 if (empty($arrayProperty["TAS_ASSIGN_VARIABLE"])) {
                     throw new \Exception("Invalid value specified for 'tas_assign_variable'");
                 }
                 $this->unsetVar($arrayProperty, "TAS_GROUP_VARIABLE");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIMEOUT");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME_UNIT");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TRIGGER_UID");
                 $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_EXECUTION");
                 break;
             case 'SELF_SERVICE':
             case 'SELF_SERVICE_EVALUATE':
                 if ($arrayProperty["TAS_ASSIGN_TYPE"] == "SELF_SERVICE_EVALUATE") {
                     if (empty($arrayProperty["TAS_GROUP_VARIABLE"])) {
                         throw new \Exception("Invalid value specified for 'tas_group_variable'");
                     }
                 } else {
                     $arrayProperty["TAS_GROUP_VARIABLE"] = '';
                 }
                 $arrayProperty["TAS_ASSIGN_TYPE"] = "SELF_SERVICE";
                 if (!($arrayProperty["TAS_SELFSERVICE_TIMEOUT"] == 0 || $arrayProperty["TAS_SELFSERVICE_TIMEOUT"] == 1)) {
                     throw new \Exception("Invalid value specified for 'tas_selfservice_timeout'");
                 }
                 if ($arrayProperty["TAS_SELFSERVICE_TIMEOUT"] == "1") {
                     if (empty($arrayProperty["TAS_SELFSERVICE_TIME"])) {
                         throw new \Exception("Invalid value specified for 'tas_assign_variable'");
                     }
                     if (empty($arrayProperty["TAS_SELFSERVICE_TIME_UNIT"])) {
                         throw new \Exception("Invalid value specified for 'tas_selfservice_time_unit'");
                     }
                     if (empty($arrayProperty["TAS_SELFSERVICE_TRIGGER_UID"])) {
                         throw new \Exception("Invalid value specified for 'tas_selfservice_trigger_uid'");
                     }
                     if (empty($arrayProperty["TAS_SELFSERVICE_EXECUTION"])) {
                         throw new \Exception("Invalid value specified for 'tas_selfservice_execution'");
                     }
                 } else {
                     $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME");
                     $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TIME_UNIT");
                     $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_TRIGGER_UID");
                     $this->unsetVar($arrayProperty, "TAS_SELFSERVICE_EXECUTION");
                 }
                 break;
             case "MULTIPLE_INSTANCE_VALUE_BASED":
                 if (trim($arrayProperty["TAS_ASSIGN_VARIABLE"]) == "") {
                     throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_CAN_NOT_BE_EMPTY", array(strtolower("TAS_ASSIGN_VARIABLE"))));
                 }
                 break;
         }
         //Validating TAS_TRANSFER_FLY value
         if ($arrayProperty["TAS_TRANSFER_FLY"] == "FALSE") {
             if (!isset($arrayProperty["TAS_DURATION"])) {
                 throw new \Exception("Invalid value specified for 'tas_duration'");
             }
             $valuesTimeUnit = array('DAYS', 'HOURS', 'MINUTES');
             if (!isset($arrayProperty["TAS_TIMEUNIT"]) || !in_array($arrayProperty["TAS_TIMEUNIT"], $valuesTimeUnit)) {
                 throw new \Exception("Invalid value specified for 'tas_timeunit'");
             }
             $valuesTypeDay = array('1', '2', '');
             if (!isset($arrayProperty["TAS_TYPE_DAY"]) || !in_array($arrayProperty["TAS_TYPE_DAY"], $valuesTypeDay)) {
                 throw new \Exception("Invalid value specified for 'tas_type_day'");
             }
             if (!isset($arrayProperty["TAS_CALENDAR"])) {
                 throw new \Exception("Invalid value specified for 'tas_calendar'");
             }
         } else {
             $this->unsetVar($arrayProperty, "TAS_DURATION");
             $this->unsetVar($arrayProperty, "TAS_TIMEUNIT");
             $this->unsetVar($arrayProperty, "TAS_TYPE_DAY");
             $this->unsetVar($arrayProperty, "TAS_CALENDAR");
         }
         if ($arrayProperty["TAS_SEND_LAST_EMAIL"] == "TRUE") {
             if (empty($arrayProperty["TAS_DEF_SUBJECT_MESSAGE"])) {
                 throw new \Exception("Invalid value specified for 'tas_def_subject_message'");
             }
             $valuesDefMessageType = array('template', 'text');
             if (!isset($arrayProperty["TAS_DEF_MESSAGE_TYPE"]) || !in_array($arrayProperty["TAS_DEF_MESSAGE_TYPE"], $valuesDefMessageType)) {
                 throw new \Exception("Invalid value specified for 'tas_def_message_type'");
             }
             if ($arrayProperty["TAS_DEF_MESSAGE_TYPE"] == 'template') {
                 if (empty($arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"])) {
                     throw new \Exception("Invalid value specified for 'tas_def_message_template'");
                 }
                 $this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE");
             } else {
                 if (empty($arrayProperty["TAS_DEF_MESSAGE"])) {
                     throw new \Exception("Invalid value specified for 'tas_def_message'");
                 }
                 $this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TEMPLATE");
             }
             //Additional configuration
             if (isset($arrayProperty["TAS_DEF_MESSAGE_TYPE"])) {
                 \G::LoadClass("configuration");
                 $oConf = new \Configurations();
                 if (!isset($arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"])) {
                     $arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"] = "alert_message.html";
                 }
                 $oConf->aConfig = array("TAS_DEF_MESSAGE_TYPE" => $arrayProperty["TAS_DEF_MESSAGE_TYPE"], "TAS_DEF_MESSAGE_TEMPLATE" => $arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"]);
                 $oConf->saveConfig("TAS_EXTRA_PROPERTIES", $arrayProperty["TAS_UID"], "", "");
             }
         } else {
             $this->unsetVar($arrayProperty, "TAS_DEF_SUBJECT_MESSAGE");
             $this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TYPE");
             $this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE");
             $this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TEMPLATE");
         }
         $result = $task->update($arrayProperty);
         if (!empty($arrayProperty['CONSOLIDATE_DATA'])) {
             if (!empty($arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'])) {
                 G::LoadClass("consolidatedCases");
                 $consolidated = new \ConsolidatedCases();
                 $dataConso = array('con_status' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_enable'], 'tas_uid' => $arrayProperty['TAS_UID'], 'dyn_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'], 'pro_uid' => $arrayProperty['PRO_UID'], 'rep_uid' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_report_table'], 'table_name' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_table'], 'title' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_title']);
                 $consolidated->saveConsolidated($dataConso);
             }
         }
         $arrayResult["status"] = "OK";
         if ($result == 3) {
             $arrayResult["status"] = "CRONCL";
         }
         return $arrayResult;
     } catch (Exception $e) {
         throw $e;
     }
 }
Example #23
0
     $rs = GulliverBasePeer::doSelectRs($c);
 }
 $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
 $rs->next();
 $totalCount = 0;
 for ($j = 0; $j < $rs->getRecordCount(); $j++) {
     $result = $rs->getRow();
     $result["FILEDOCEXIST"] = $result["FILEDOC"];
     $result["FILEPDFEXIST"] = $result["FILEPDF"];
     $result["DELETE_FILE"] = isset($result['ID_DELETE']) && $result['ID_DELETE'] == 'Delete' ? true : false;
     $aProcesses[] = $result;
     $rs->next();
     $totalCount++;
 }
 //!dateFormat
 $conf = new Configurations();
 try {
     $globaleneralConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
 } catch (Exception $e) {
     $generalConfCasesList = array();
 }
 $dateFormat = "";
 $varFlag = isset($generalConfCasesList['casesListDateFormat']);
 if ($varFlag && !empty($generalConfCasesList['casesListDateFormat'])) {
     $dateFormat = $generalConfCasesList['casesListDateFormat'];
 }
 $r = new stdclass();
 $r->data = $aProcesses;
 $r->totalCount = $totalCount;
 $r->dataFormat = $dateFormat;
 echo Bootstrap::json_encode($r);
Example #24
0
 function getProcessArray($action, $userUid)
 {
     global $oAppCache;
     $processes = array();
     $processes[] = array("", G::LoadTranslation("ID_ALL_PROCESS"));
     switch ($action) {
         case "simple_search":
         case "search":
             //In search action, the query to obtain all process is too slow, so we need to query directly to
             //process and content tables, and for that reason we need the current language in AppCacheView.
             G::loadClass("configuration");
             $oConf = new Configurations();
             $oConf->loadConfig($x, "APP_CACHE_VIEW_ENGINE", "", "", "", "");
             $appCacheViewEngine = $oConf->aConfig;
             $lang = isset($appCacheViewEngine["LANG"]) ? $appCacheViewEngine["LANG"] : "en";
             $cProcess = new Criteria("workflow");
             $cProcess->clearSelectColumns();
             $cProcess->addSelectColumn(ProcessPeer::PRO_UID);
             $cProcess->addSelectColumn(ContentPeer::CON_VALUE);
             $del = DBAdapter::getStringDelimiter();
             $conds = array();
             $conds[] = array(ProcessPeer::PRO_UID, ContentPeer::CON_ID);
             $conds[] = array(ContentPeer::CON_CATEGORY, $del . "PRO_TITLE" . $del);
             $conds[] = array(ContentPeer::CON_LANG, $del . $lang . $del);
             $cProcess->addJoinMC($conds, Criteria::LEFT_JOIN);
             $cProcess->add(ProcessPeer::PRO_STATUS, "ACTIVE");
             $oDataset = ProcessPeer::doSelectRS($cProcess);
             $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
             $oDataset->next();
             while ($aRow = $oDataset->getRow()) {
                 $processes[] = array($aRow["PRO_UID"], $aRow["CON_VALUE"]);
                 $oDataset->next();
             }
             return $processes;
             break;
         case "consolidated":
         default:
             $cProcess = $oAppCache->getToDoListCriteria($userUid);
             //fast enough
             break;
     }
     $cProcess->clearSelectColumns();
     $cProcess->setDistinct();
     $cProcess->addSelectColumn(AppCacheViewPeer::PRO_UID);
     $cProcess->addSelectColumn(AppCacheViewPeer::APP_PRO_TITLE);
     $oDataset = AppCacheViewPeer::doSelectRS($cProcess);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     while ($aRow = $oDataset->getRow()) {
         $processes[] = array($aRow["PRO_UID"], $aRow["APP_PRO_TITLE"]);
         $oDataset->next();
     }
     return $processes;
 }
Example #25
0
             $aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_SETUP';
             break;
         case 'PROCESSMAKER_OPERATOR':
             $aFields['PREF_DEFAULT_MENUSELECTED'] = 'PM_CASES';
             break;
     }
     $aFields['PREF_DEFAULT_LANG'] = SYS_LANG;
 }
 if ($aFields['USR_REPLACED_BY'] != '') {
     $user = new Users();
     $u = $user->load($aFields['USR_REPLACED_BY']);
     if ($u['USR_STATUS'] == 'CLOSED') {
         $replaced_by = '';
         $aFields['USR_REPLACED_BY'] = '';
     } else {
         $c = new Configurations();
         $replaced_by = $c->usersNameFormat($u['USR_USERNAME'], $u['USR_FIRSTNAME'], $u['USR_LASTNAME']);
     }
 } else {
     $replaced_by = '';
 }
 $aFields['REPLACED_NAME'] = $replaced_by;
 $menuSelected = '';
 if ($aFields['PREF_DEFAULT_MENUSELECTED'] != '') {
     foreach ($RBAC->aUserInfo['PROCESSMAKER']['PERMISSIONS'] as $permission) {
         if ($aFields['PREF_DEFAULT_MENUSELECTED'] == $permission['PER_CODE']) {
             switch ($permission['PER_CODE']) {
                 case 'PM_USERS':
                 case 'PM_SETUP':
                     $menuSelected = strtoupper(G::LoadTranslation('ID_SETUP'));
                     break;
Example #26
0
 public function saveOrderDashlet($data)
 {
     $this->setResponseType('json');
     try {
         $orderDashlet[0] = Bootstrap::json_decode($data->positionCol0);
         $orderDashlet[1] = Bootstrap::json_decode($data->positionCol1);
         $orderDashlet[2] = Bootstrap::json_decode($data->positionCol2);
         G::loadClass('configuration');
         $oConfiguration = new Configurations();
         $aConfiguration = $oConfiguration->load('Dashboard', '', '', $_SESSION['USER_LOGGED']);
         $dataDashboard = array();
         if (isset($aConfiguration["CFG_VALUE"])) {
             $dataDashboard = $aConfiguration["CFG_VALUE"];
         }
         $dataNow['ORDER'] = $orderDashlet;
         if (isset($data->columns)) {
             $dataNow['COLUMNS'] = Bootstrap::json_decode($data->columns);
         }
         $dataDashboard = array_merge($dataDashboard, $dataNow);
         $oConfiguration->aConfig = $dataDashboard;
         $oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']);
         $result->success = '1';
         return $result;
     } catch (Exception $error) {
         //ToDo: Display a error message
     }
 }
Example #27
0
 private function _default()
 {
     require_once PATH_THIRDPARTY . 'smarty/libs/Smarty.class.php';
     // put full path to Smarty.class.php
     global $G_ENABLE_BLANK_SKIN;
     //menu
     global $G_PUBLISH;
     global $G_MAIN_MENU;
     global $G_SUB_MENU;
     global $G_MENU_SELECTED;
     global $G_SUB_MENU_SELECTED;
     global $G_ID_MENU_SELECTED;
     global $G_ID_SUB_MENU_SELECTED;
     G::verifyPath(PATH_SMARTY_C, true);
     G::verifyPath(PATH_SMARTY_CACHE, true);
     $smarty = new Smarty();
     $oHeadPublisher =& headPublisher::getSingleton();
     $smarty->compile_dir = PATH_SMARTY_C;
     $smarty->cache_dir = PATH_SMARTY_CACHE;
     $smarty->config_dir = PATH_THIRDPARTY . 'smarty/configs';
     //To setup en extJS Theme for this Skin
     G::LoadClass('serverConfiguration');
     $oServerConf =& serverConf::getSingleton();
     $extSkin = $oServerConf->getProperty("extSkin");
     if (!$extSkin) {
         $extSkin = array();
     }
     $extSkin[SYS_SKIN] = "xtheme-gray";
     $oServerConf->setProperty("extSkin", $extSkin);
     //End of extJS Theme setup
     if (isset($G_ENABLE_BLANK_SKIN) && $G_ENABLE_BLANK_SKIN) {
         $smarty->template_dir = $this->layoutFileBlank['dirname'];
         $smarty->force_compile = $this->forceTemplateCompile;
         $smarty->display($layoutFileBlank['basename']);
     } else {
         $smarty->template_dir = $this->layoutFile['dirname'];
         $meta = null;
         $header = null;
         if (preg_match("/^.*\\(.*MSIE (\\d+)\\..+\\).*\$/", $_SERVER["HTTP_USER_AGENT"], $arrayMatch)) {
             $ie = intval($arrayMatch[1]);
             if ($ie == 10) {
                 $ie = 8;
                 $meta = "<meta http-equiv=\"X-UA-Compatible\" content=\"IE={$ie}\" />";
             }
         }
         if (isset($oHeadPublisher)) {
             if (defined('SYS_SYS')) {
                 $oHeadPublisher->title = isset($_SESSION['USR_USERNAME']) ? '(' . $_SESSION['USR_USERNAME'] . ' ' . G::LoadTranslation('ID_IN') . ' ' . SYS_SYS . ')' : '';
             }
             $header = $oHeadPublisher->printHeader();
             $header .= $oHeadPublisher->getExtJsStylesheets($this->cssFileName);
         }
         $smarty->assign("meta", $meta);
         $smarty->assign("header", $header);
         $footer = '';
         if (strpos($_SERVER['REQUEST_URI'], '/login/login') !== false) {
             $freeOfChargeText = "";
             if (!defined('SKIP_FREE_OF_CHARGE_TEXT')) {
                 $freeOfChargeText = "Supplied free of charge with no support, certification, warranty, <br>maintenance nor indemnity by Colosa and its Certified Partners.";
             }
             if (class_exists('pmLicenseManager')) {
                 $freeOfChargeText = "";
             }
             $fileFooter = PATH_SKINS . SYS_SKIN . PATH_SEP . 'footer.html';
             if (file_exists($fileFooter)) {
                 $footer .= file_get_contents($fileFooter);
             } else {
                 $fileFooter = PATH_SKIN_ENGINE . SYS_SKIN . PATH_SEP . 'footer.html';
                 if (file_exists($fileFooter)) {
                     $footer .= file_get_contents($fileFooter);
                 } else {
                     $fileFooter = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . 'footer.html';
                     if (file_exists($fileFooter)) {
                         $footer .= file_get_contents($fileFooter);
                     } else {
                         $footer .= "<br />Copyright &copy; 2003-" . date('Y') . " <a href=\"http://www.colosa.com\" alt=\"Colosa, Inc.\" target=\"_blank\">Colosa, Inc.</a> All rights reserved.<br /> {$freeOfChargeText} " . "<br><br/><a href=\"http://www.processmaker.com\" alt=\"Powered by ProcessMaker - Open Source Workflow & Business Process Management (BPM) Management Software\" title=\"Powered by ProcessMaker\" target=\"_blank\"></a>";
                     }
                 }
             }
         }
         $oMenu = new Menu();
         $menus = $oMenu->generateArrayForTemplate($G_MAIN_MENU, 'SelectedMenu', 'mainMenu', $G_MENU_SELECTED, $G_ID_MENU_SELECTED);
         $smarty->assign('menus', $menus);
         $oSubMenu = new Menu();
         $subMenus = $oSubMenu->generateArrayForTemplate($G_SUB_MENU, 'selectedSubMenu', 'subMenu', $G_SUB_MENU_SELECTED, $G_ID_SUB_MENU_SELECTED);
         $smarty->assign('subMenus', $subMenus);
         if (!defined('NO_DISPLAY_USERNAME')) {
             define('NO_DISPLAY_USERNAME', 0);
         }
         if (NO_DISPLAY_USERNAME == 0) {
             $switch_interface = isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'SWITCHABLE';
             $smarty->assign('user_logged', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
             $smarty->assign('tracker', SYS_COLLECTION == 'tracker' ? $G_PUBLISH->Parts[0]['File'] != 'tracker/login' ? true : '' : '');
             $smarty->assign('switch_interface', $switch_interface);
             $smarty->assign('switch_interface_label', G::LoadTranslation('ID_SWITCH_INTERFACE'));
             $smarty->assign('rolename', isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] . '' : '');
             $smarty->assign('pipe', isset($_SESSION['USR_USERNAME']) ? ' | ' : '');
             $smarty->assign('logout', G::LoadTranslation('ID_LOGOUT'));
             $smarty->assign('workspace', defined('SYS_SYS') ? SYS_SYS : '');
             $uws = isset($_SESSION['USR_ROLENAME']) && $_SESSION['USR_ROLENAME'] != '' ? strtolower(G::LoadTranslation('ID_WORKSPACE_USING')) : G::LoadTranslation('ID_WORKSPACE_USING');
             $smarty->assign('workspace_label', $uws);
             G::LoadClass("configuration");
             $conf = new Configurations();
             $conf->getFormats();
             if (defined('SYS_SYS')) {
                 $smarty->assign('udate', $conf->getSystemDate(date('Y-m-d H:i:s')));
             } else {
                 $smarty->assign('udate', G::getformatedDate(date('Y-m-d H:i:s'), 'M d, yyyy', SYS_LANG));
             }
             $name = $conf->userNameFormat(isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : '', isset($_SESSION['USR_FULLNAME']) ? htmlentities($_SESSION['USR_FULLNAME'], ENT_QUOTES, 'UTF-8') : '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
             $smarty->assign('user', $name);
         }
         if (class_exists('pmLicenseManager')) {
             $pmLicenseManagerO =& pmLicenseManager::getSingleton();
             $expireIn = $pmLicenseManagerO->getExpireIn();
             $expireInLabel = $pmLicenseManagerO->getExpireInLabel();
             //if($expireIn<=30){
             if ($expireInLabel != "") {
                 $smarty->assign('msgVer', '<label class="textBlack">' . $expireInLabel . '</label>&nbsp;&nbsp;');
             }
             //}
         }
         if (defined('SYS_SYS')) {
             $logout = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/login/login';
         } else {
             $logout = '/sys/' . SYS_LANG . '/' . SYS_SKIN . '/login/login';
         }
         $smarty->assign('linklogout', $logout);
         $smarty->assign('footer', $footer);
         $smarty->assign('tpl_menu', PATH_TEMPLATE . 'menu.html');
         $smarty->assign('tpl_submenu', PATH_TEMPLATE . 'submenu.html');
         G::LoadClass('replacementLogo');
         $oLogoR = new replacementLogo();
         if (defined("SYS_SYS")) {
             $aFotoSelect = $oLogoR->getNameLogo(isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
             if (is_array($aFotoSelect)) {
                 $sFotoSelect = trim($aFotoSelect['DEFAULT_LOGO_NAME']);
                 $sWspaceSelect = trim($aFotoSelect['WORKSPACE_LOGO_NAME']);
             }
         }
         if (class_exists('PMPluginRegistry')) {
             $oPluginRegistry =& PMPluginRegistry::getSingleton();
             if (isset($sFotoSelect) && $sFotoSelect != '' && !strcmp($sWspaceSelect, SYS_SYS)) {
                 $sCompanyLogo = $oPluginRegistry->getCompanyLogo($sFotoSelect);
                 $sCompanyLogo = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/showLogoFile.php?id=" . base64_encode($sCompanyLogo);
             } else {
                 $sCompanyLogo = $oPluginRegistry->getCompanyLogo('/images/processmaker.logo.jpg');
             }
         } else {
             $sCompanyLogo = '/images/processmaker.logo.jpg';
         }
         $smarty->assign('logo_company', $sCompanyLogo);
         $smarty->force_compile = $this->forceTemplateCompile;
         $smarty->display($this->layoutFile['basename']);
     }
 }
Example #28
0
    public function getSystemDate($dateTime, $type='dateFormat')
    {
        $oConf = new Configurations();
        $oConf->getFormats();
        $dateFormat = $oConf->UserConfig['dateFormat'];
        $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
        $creationDateMask = isset($oConf->aConfig[$type]) ? $oConf->aConfig[$type] : '';
        $creationDateMask = ($creationDateMask == '') ? $dateFormat : $creationDateMask;
        if ($creationDateMask != '') {
            if (strpos($dateTime, ' ') !== false) {
                list ($date, $time) = explode(' ', $dateTime);
                list ($y, $m, $d) = explode('-', $date);
                list ($h, $i, $s) = explode(':', $time);
                $newCreation = '';
                $maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%d', 'l' => '%A', 'G' => '%I', 'g' => '%i', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%p', 'A' => '%p', 'g' => '%I', 'G' => '%H', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
                $creationDateMask = trim($creationDateMask);

                if (strpos($creationDateMask, ' \\d\\e ') !== false) {
                    $creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
                }

                for ($j = 0; $j < strlen($creationDateMask); $j++) {
                    if ($creationDateMask[$j] != ' ' && isset($maskTime[$creationDateMask[$j]])) {
                        $newCreation .= $maskTime[$creationDateMask[$j]];
                    } else {
                        $newCreation .= $creationDateMask[$j];
                    }
                }

                $langLocate = SYS_LANG;

                require_once 'model/Language.php';
                $language = new language();
                $lanLocation = $language->findLocationByLanId(SYS_LANG);
                $location = isset($lanLocation['LAN_LOCATION']) ? $lanLocation['LAN_LOCATION'] : '';    

                if (G::toLower(PHP_OS) == 'linux' || G::toLower(PHP_OS) == 'darwin') {
                    if (SYS_LANG == 'es') {
                        $langLocate = 'es_ES';
                    } else if (strlen(SYS_LANG) > 2) {
                        $langLocate = str_replace('-', '_', SYS_LANG);
                    } else if ($location != '') {
                        $langLocate = SYS_LANG.'_'.$location;
                    } else {
                        $langLocate = 'en_US';
                    }
                } else {
                    switch (SYS_LANG) {
                        case 'es':
                        case 'es_ES':
                            $langLocate = 'ESN';
                            break;
                        case 'pt':
                        case 'pt-BR':
                            $langLocate = 'PTB';
                            break;
                        case 'en':
                        case 'en-US':
                        default:
                            $langLocate = 'EST';
                            break;
                    }
                }
                
                if (defined('PARTNER_FLAG')) {
                    setlocale(LC_TIME, $langLocate);
                    $dateTime = utf8_encode(strftime($newCreation, mktime($h, $i, $s, $m, $d, $y)));
                } else {
                    setlocale(LC_TIME, $langLocate . ".utf8");
                    $dateTime = strftime($newCreation, mktime($h, $i, $s, $m, $d, $y));
                }

                if (strpos($dateTime, ' ') !== false) {
                    $dateTime = ucwords($dateTime);
                }

                if (strpos($dateTime, ' [xx] ') !== false) {
                    $dateTime = str_replace('[xx]', ' de ', $dateTime);
                }
            }
        }

        return $dateTime;
    }
Example #29
0
        //echo $logo[0]->photo_file_name;
        //Yii::app()->runController('Configurations/displayLogoImage/id/'.$logo[0]->primaryKey);
        echo '<img src="uploadedfiles/school_logo/' . $logo[0]->photo_file_name . '" alt="' . $logo[0]->photo_file_name . '" class="imgbrder" width="100%" />';
    }
    ?>
            </td>
            <td align="center" valign="middle" class="first">
            
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                    	<td class="listbxtop_hdng first" style="text-align:center;"></td>
                    </tr>
                    <tr>
                        <td class="listbxtop_hdng first" style="text-align:center; font-size:20px; ">
                        <?php 
    $college = Configurations::model()->findByPk(1);
    ?>
                        <?php 
    echo $college->config_value;
    ?>
</td>
                    </tr>
                </table>
          
            </td>
      </tr>
</table>
<h4><?php 
    echo Yii::t('employees', 'Employee Attendance Report');
    ?>
</h4>
     echo G::json_encode($result);
     break;
 case 'getLangList':
     $Translations = G::getModel('Translation');
     $result = new stdClass();
     $result->rows = array();
     $langs = $Translations->getTranslationEnvironments();
     foreach ($langs as $lang) {
         $result->rows[] = array('LAN_ID' => $lang['LOCALE'], 'LAN_NAME' => $lang['LANGUAGE']);
     }
     print G::json_encode($result);
     break;
 case 'build':
     $sqlToExe = array();
     G::LoadClass('configuration');
     $conf = new Configurations();
     //DEPRECATED $lang = $_POST['lang'];
     //there is no more support for other languages that english
     $lang = 'en';
     try {
         //setup the appcacheview object, and the path for the sql files
         $appCache = new AppCacheView();
         $appCache->setPathToAppCacheFiles(PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP);
         //APP_DELEGATION INSERT
         $res = $appCache->triggerAppDelegationInsert($lang, true);
         //$result->info[] = array ('name' => 'Trigger APP_DELEGATION INSERT',           'value'=> $res);
         //APP_DELEGATION Update
         $res = $appCache->triggerAppDelegationUpdate($lang, true);
         //$result->info[] = array ('name' => 'Trigger APP_DELEGATION UPDATE',           'value'=> $res);
         //APPLICATION UPDATE
         $res = $appCache->triggerApplicationUpdate($lang, true);