diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index cd4cf8dac..5ba76ab5a 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -5451,21 +5451,39 @@ class G } /** - */ + * This function save history about some actions in the file audit.log + * The data is used in the Audit Log functionality + * + * @param string $actionToLog + * @param string $valueToLog + * @return void + */ public static function auditLog($actionToLog, $valueToLog = "") { - $workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; + $workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; $conf = new Configurations(); $sflag = $conf->getConfiguration('AUDIT_LOG', 'log'); $sflagAudit = $sflag == 'true' ? true : false; $ipClient = G::getIpAddress(); + $userUid = 'Unknow User'; + $fullName = '-'; /*----------------------------------********---------------------------------*/ $licensedFeatures = PMLicensedFeatures::getSingleton(); if ($sflagAudit && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) { - $username = isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '' ? $_SESSION['USER_LOGGED'] : 'Unknow User'; - $fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : '-'; - G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log"); + if (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') { + $userUid = $_SESSION['USER_LOGGED']; + } else { + //Get the usrUid related to the accessToken + $userUid = \ProcessMaker\Services\OAuth2\Server::getUserId(); + if (!empty($userUid)) { + $oUserLogged = new \Users(); + $user = $oUserLogged->loadDetails($userUid); + $fullName = $user['USR_FULLNAME']; + } + } + $fullName = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : $fullName; + G::log("|". $workspace ."|". $ipClient ."|". $userUid . "|" . $fullName ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log"); } /*----------------------------------********---------------------------------*/ } diff --git a/workflow/engine/bin/tasks/cliWorkspaces.php b/workflow/engine/bin/tasks/cliWorkspaces.php index 556ee4d71..0e25d885b 100644 --- a/workflow/engine/bin/tasks/cliWorkspaces.php +++ b/workflow/engine/bin/tasks/cliWorkspaces.php @@ -193,11 +193,10 @@ CLI::taskRun("run_database_generate_self_service_by_value"); CLI::taskName('database-verify-consistency'); CLI::taskDescription(<<next(); $row = $rs->getRow(); $iLastStep = intval($row[0]); - + if ($iPosition > $iLastStep) { + throw (new Exception(G::LoadTranslation('ID_STEP_DOES_NOT_EXIST', array(G::LoadTranslation('ID_POSITION'), $iPosition)))); + } $iPosition += 1; $aNextStep = null; if ($iPosition <= $iLastStep) { diff --git a/workflow/engine/classes/class.pmDynaform.php b/workflow/engine/classes/class.pmDynaform.php index 5bfe623b6..61d0b6e4d 100644 --- a/workflow/engine/classes/class.pmDynaform.php +++ b/workflow/engine/classes/class.pmDynaform.php @@ -754,6 +754,10 @@ class pmDynaform preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE); $variables = isset($result[2]) ? $result[2] : array(); foreach ($variables as $key => $value) { + //Prevents an infinite cycle. If the name of the variable is used within its own dependent. + if ($value[0] === $json->variable) { + continue; + } $jsonSearch = $this->jsonsf(G::json_decode($this->record["DYN_CONTENT"]), $value[0], $json->variable === "" ? "id" : "variable"); $a = $this->getValuesDependentFields($jsonSearch); foreach ($a as $i => $v) { diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 21cd3f060..25cb5edaf 100644 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -1722,6 +1722,9 @@ function PMFAddInputDocument( * @label PMF Generate Output Document * * @param string(32) | $outputID | Output ID | Output Document ID + * @param string(32) | $sApplication = null | Case ID | The unique ID for a case + * @param string(32) | $index = null | Index | Value for Index + * @param string(32) | $sUserLogged = null | User UID | User Logged UID * @return none | $none | None | None * */ @@ -3125,7 +3128,7 @@ function PMFGeti18nText($id, $category, $lang = "en") * @method * The requested text in the specified language | If not found returns false * @name PMFUnCancelCase - * @label PMF Un Cancel Case + * @label PMF Restore Case * @param string | $caseUID | ID Case | Is the unique UID of the case * @param string | $userUID | ID User | Is the unique ID of the user who will uncancel the case * @return int | $value | Return | Returns 1 if the case was successfully uncancelled, otherwise returns 0 if an error ocurred diff --git a/workflow/engine/classes/class.spool.php b/workflow/engine/classes/class.spool.php index ce9b24f77..5df8cb1bd 100644 --- a/workflow/engine/classes/class.spool.php +++ b/workflow/engine/classes/class.spool.php @@ -86,8 +86,8 @@ class spoolRun $this->ExceptionCode['WARNING'] = 2; $this->ExceptionCode['NOTICE'] = 3; - $this->longMailEreg = "/(.*)(<([\w\-\.']+@[\w\-_\.]+\.\w{2,5})+>)/"; - $this->mailEreg = "/^([\w\-_\.']+@[\w\-_\.]+\.\w{2,5}+)$/"; + $this->longMailEreg = "/(.*)(<([\w\-\+\.']+@[\w\-_\.]+\.\w{2,5})+>)/"; + $this->mailEreg = "/^([\w\-_\+\.']+@[\w\-_\.]+\.\w{2,5}+)$/"; } /** diff --git a/workflow/engine/classes/model/ListCanceled.php b/workflow/engine/classes/model/ListCanceled.php index e9e521340..c01224f16 100644 --- a/workflow/engine/classes/model/ListCanceled.php +++ b/workflow/engine/classes/model/ListCanceled.php @@ -99,6 +99,9 @@ class ListCanceled extends BaseListCanceled $oListInbox = new ListInbox(); $oListInbox->removeAll($data['APP_UID']); + //We need to remove the cancelled case from unassigned list if the record exists + $unassigned = new ListUnassigned(); + $unassigned->remove($data['APP_UID'], $data['DEL_INDEX']); //Update - WHERE $criteriaWhere = new Criteria("workflow"); diff --git a/workflow/engine/content/translations/english/processmaker.en.po b/workflow/engine/content/translations/english/processmaker.en.po index 775a07bcb..e3c24a29d 100644 --- a/workflow/engine/content/translations/english/processmaker.en.po +++ b/workflow/engine/content/translations/english/processmaker.en.po @@ -2113,6 +2113,24 @@ msgstr "This case does not exist" msgid "Application ID or Delegation Index is missing!. The System can not open the case." msgstr "Application ID or Delegation Index is missing!. The System can not open the case." +# TRANSLATION +# LABEL/ID_MEMORY_LIMIT_VALIDATE +#: LABEL/ID_MEMORY_LIMIT_VALIDATE +msgid "Memory Limit value has to be either a positive integer or -1." +msgstr "Memory Limit value has to be either a positive integer or -1." + +# TRANSLATION +# LABEL/ID_LIFETIME_VALIDATE +#: LABEL/ID_LIFETIME_VALIDATE +msgid "Max Lifetime value has to be a positive integer." +msgstr "Max Lifetime value has to be a positive integer." + +# TRANSLATION +# LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE +#: LABEL/ID_DEFAULT_EXPIRATION_YEAR_VALIDATE +msgid "Default Expiration Year value has to be a positive integer." +msgstr "Default Expiration Year value has to be a positive integer." + # TRANSLATION # LABEL/ID_PLEASE_SELECT_UPGRADE_FILE #: LABEL/ID_PLEASE_SELECT_UPGRADE_FILE @@ -3064,8 +3082,8 @@ msgstr "Role" # TRANSLATION # LABEL/ID_MSG_CANNOT_DELETE_USER #: LABEL/ID_MSG_CANNOT_DELETE_USER -msgid "User cannot be deleted while still assigned to cases." -msgstr "User cannot be deleted while still assigned to cases." +msgid "The user cannot be deleted since it is referenced in a process design and/or has assigned cases." +msgstr "The user cannot be deleted since it is referenced in a process design and/or has assigned cases." # TRANSLATION # LABEL/ID_MSG_REMOVE_PLUGIN @@ -6082,8 +6100,8 @@ msgstr "First select a PM Table from the list please." # TRANSLATION # LABEL/ID_CONFIRM_DELETE_PM_TABLE #: LABEL/ID_CONFIRM_DELETE_PM_TABLE -msgid "Do you want to delete selected tables?" -msgstr "Do you want to delete selected tables?" +msgid "Do you want to delete the selected tables?" +msgstr "Do you want to delete the selected tables?" # TRANSLATION # LABEL/ID_TITLE_START_CASE @@ -6346,8 +6364,8 @@ msgstr "First select a ROW from the list" # TRANSLATION # LABEL/ID_MSG_CONFIRM_DELETE_ROW #: LABEL/ID_MSG_CONFIRM_DELETE_ROW -msgid "Do you want to delete selected row?" -msgstr "Do you want to delete selected row?" +msgid "Do you want to delete the selected row?" +msgstr "Do you want to delete the selected row?" # TRANSLATION # LABEL/ID_SENT_BY @@ -7300,8 +7318,8 @@ msgstr "Edit Department" # TRANSLATION # LABEL/ID_CONFIRM_DELETE_DEPARTMENT #: LABEL/ID_CONFIRM_DELETE_DEPARTMENT -msgid "Do you want to delete selected department?" -msgstr "Do you want to delete selected department?" +msgid "Do you want to delete the selected department?" +msgstr "Do you want to delete the selected department?" # TRANSLATION # LABEL/ID_DEPARTMENT_SUCCESS_DELETE @@ -7390,8 +7408,8 @@ msgstr "The category cannot be deleted while it is still assigned to processes." # TRANSLATION # LABEL/ID_CONFIRM_DELETE_CATEGORY #: LABEL/ID_CONFIRM_DELETE_CATEGORY -msgid "Do you want to delete selected category?" -msgstr "Do you want to delete selected category?" +msgid "Do you want to delete the selected category?" +msgstr "Do you want to delete the selected category?" # TRANSLATION # LABEL/ID_GROUP_USERS @@ -8134,8 +8152,8 @@ msgstr "Starting Task" # TRANSLATION # LABEL/ID_CONFIRM_DELETE_AUTHENTICATION #: LABEL/ID_CONFIRM_DELETE_AUTHENTICATION -msgid "Do you want to delete selected authentication source?" -msgstr "Do you want to delete selected authentication source?" +msgid "Do you want to delete the selected authentication source?" +msgstr "Do you want to delete the selected authentication source?" # TRANSLATION # LABEL/ID_ASSIGNMENT_RULES @@ -8902,8 +8920,8 @@ msgstr "Rich Text File" # TRANSLATION # LABEL/ID_CONFIRM_DELETE_CALENDAR #: LABEL/ID_CONFIRM_DELETE_CALENDAR -msgid "Do you want to delete selected calendar?" -msgstr "Do you want to delete selected calendar?" +msgid "Do you want to delete the selected calendar?" +msgstr "Do you want to delete the selected calendar?" # TRANSLATION # LABEL/ID_CALENDAR_SUCCESS_DELETE @@ -9418,8 +9436,8 @@ msgstr "Input Document has been deleted correctly." # TRANSLATION # LABEL/ID_CONFIRM_DELETE_INPUT_DOC #: LABEL/ID_CONFIRM_DELETE_INPUT_DOC -msgid "Do you want to delete selected Input Document?" -msgstr "Do you want to delete selected Input Document?" +msgid "Do you want to delete the selected Input Document?" +msgstr "Do you want to delete the selected Input Document?" # TRANSLATION # LABEL/ID_MSG_CANNOT_DELETE_INPUT_DOC @@ -10450,8 +10468,8 @@ msgstr "From each table select at least one Schema/Data to export." # TRANSLATION # LABEL/ID_CONFIRM_DELETE_SKIN #: LABEL/ID_CONFIRM_DELETE_SKIN -msgid "Do you want to delete selected skin?" -msgstr "Do you want to delete selected skin?" +msgid "Do you want to delete the selected skin?" +msgstr "Do you want to delete the selected skin?" # TRANSLATION # LABEL/ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index df7d0b660..dc3c22f7f 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -27,28 +27,18 @@ class adminProxy extends HttpProxyController { const hashunlink = 'unlink'; + /** + * Save configurations of systemConf + * @param $httpData + * @throws Exception + */ public function saveSystemConf($httpData) { G::loadClass('system'); $envFile = PATH_CONFIG . 'env.ini'; $updateRedirector = false; $restart = false; - - if (!file_exists($envFile) ) { - if (!is_writable(PATH_CONFIG)) { - throw new Exception('The enviroment config directory is not writable.
Please give write permission to directory: /workflow/engine/config'); - } - $content = ";\r\n"; - $content .= "; ProcessMaker System Bootstrap Configuration\r\n"; - $content .= ";\r\n"; - file_put_contents($envFile, $content); - //@chmod($envFile, 0777); - } else { - if (!is_writable($envFile)) { - throw new Exception('The enviroment ini file file is not writable.
Please give write permission to file: /workflow/engine/config/env.ini'); - } - } - + self::validateDataSystemConf($httpData, $envFile); $sysConf = System::getSystemConfiguration($envFile); $updatedConf = array(); @@ -1536,5 +1526,46 @@ class adminProxy extends HttpProxyController G::streamFile($support, true); G::rm_dir($support); } -} + /** + * Validate data before saving + * @param $httpData + * @param $envFile + * @throws Exception + */ + public static function validateDataSystemConf($httpData, $envFile) + { + if (!((is_numeric($httpData->memory_limit)) && ((int)$httpData->memory_limit == $httpData->memory_limit) && + ((int)$httpData->memory_limit >= -1)) + ) { + throw new Exception(G::LoadTranslation('ID_MEMORY_LIMIT_VALIDATE')); + } + + if (!((is_numeric($httpData->max_life_time)) && ((int)$httpData->max_life_time == $httpData->max_life_time) && + ((int)$httpData->max_life_time > 0)) + ) { + throw new Exception(G::LoadTranslation('ID_LIFETIME_VALIDATE')); + } + + if (!((is_numeric($httpData->expiration_year)) && ((int)$httpData->expiration_year == $httpData->expiration_year) && + ((int)$httpData->expiration_year > 0)) + ) { + throw new Exception(G::LoadTranslation('ID_DEFAULT_EXPIRATION_YEAR_VALIDATE')); + } + + if (!file_exists($envFile)) { + if (!is_writable(PATH_CONFIG)) { + throw new Exception('The enviroment config directory is not writable.
Please give write permission to directory: /workflow/engine/config'); + } + $content = ";\r\n"; + $content .= "; ProcessMaker System Bootstrap Configuration\r\n"; + $content .= ";\r\n"; + file_put_contents($envFile, $content); + //@chmod($envFile, 0777); + } else { + if (!is_writable($envFile)) { + throw new Exception('The enviroment ini file is not writable.
Please give write permission to file: /workflow/engine/config/env.ini'); + } + } + } +} \ No newline at end of file diff --git a/workflow/engine/controllers/newSiteProxy.php b/workflow/engine/controllers/newSiteProxy.php index 969454bef..88726845d 100644 --- a/workflow/engine/controllers/newSiteProxy.php +++ b/workflow/engine/controllers/newSiteProxy.php @@ -30,9 +30,9 @@ class newSiteProxy extends HttpProxyController return; } } - $user = (isset( $_POST['NW_USERNAME'] )) ? trim( $_POST['NW_USERNAME'] ) : 'admin'; - $pass = (isset( $_POST['NW_PASSWORD'] )) ? $_POST['NW_PASSWORD'] : 'admin'; - $pass1 = (isset( $_POST['NW_PASSWORD2'] )) ? $_POST['NW_PASSWORD2'] : 'admin'; + $user = (isset($_POST['NW_USERNAME'])) ? trim($_POST['NW_USERNAME']) : 'admin'; + $pass = (isset($_POST['NW_PASSWORD'])) ? trim($_POST['NW_PASSWORD']) : 'admin'; + $pass1 = (isset($_POST['NW_PASSWORD2'])) ? trim($_POST['NW_PASSWORD2']) : 'admin'; $ao_db_wf = (isset( $_POST['AO_DB_WF'] )) ? $_POST['AO_DB_WF'] : false; diff --git a/workflow/engine/data/mysql/insert.sql b/workflow/engine/data/mysql/insert.sql index 43d8e21e7..fb6c052e6 100644 --- a/workflow/engine/data/mysql/insert.sql +++ b/workflow/engine/data/mysql/insert.sql @@ -1793,6 +1793,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_IN','en','in','2014-01-15') , ( 'LABEL','ID_CASE_DOES_NOT_EXISTS','en','This case does not exist','2014-01-15') , ( 'LABEL','ID_APPLICATION_OR_INDEX_MISSING','en','Application ID or Delegation Index is missing!. The System can not open the case.','2017-03-30') , +( 'LABEL','ID_MEMORY_LIMIT_VALIDATE','en','Memory Limit value has to be either a positive integer or -1','2017-04-05') , +( 'LABEL','ID_LIFETIME_VALIDATE','en','Max Lifetime value has to be a positive integer','2017-04-05') , +( 'LABEL','ID_DEFAULT_EXPIRATION_YEAR_VALIDATE','en','Default Expiration Year value has to be a positive integer','2017-04-05') , ( 'LABEL','ID_PLEASE_SELECT_UPGRADE_FILE','en','Please select the upgrade file','2014-01-15') , ( 'LABEL','ID_PLEASE_SELECT_MAX_X_FIELDS','en','Please select 80 fields at most','2014-01-15') , ( 'LABEL','ID_UPGRADE_READY','en','System upgraded from revision','2014-01-15') , @@ -1954,7 +1957,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_PENDING','en','Pending','2014-01-15') , ( 'LABEL','ID_FULL_NAME','en','Full Name','2014-01-15') , ( 'LABEL','ID_ROLE','en','Role','2014-01-15') , -( 'LABEL','ID_MSG_CANNOT_DELETE_USER','en','User cannot be deleted while still assigned to cases.','2014-10-21') , +( 'LABEL','ID_MSG_CANNOT_DELETE_USER','en','The user cannot be deleted since it is referenced in a process design and/or has assigned cases.','2017-03-22') , ( 'LABEL','ID_MSG_REMOVE_PLUGIN','en','Are you sure that you want to remove this plugin?','2014-01-15') , ( 'JAVASCRIPT','USERS_REASSIGN','en','This user cannot be deleted because he/she still has some pending tasks.

Do you want to reassign these tasks to another user now?','2014-01-15') , ( 'LABEL','LOGIN_VERIFY_MSG','en','Verifying...','2014-01-15') , @@ -2469,7 +2472,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_NEW_ADD_TABLE','en','New PM Table','2014-01-15') , ( 'LABEL','ID_FIELD_DYNAFORM_TEXT','en','text','2014-01-15') , ( 'LABEL','ID_SELECT_FIRST_PM_TABLE_ROW','en','First select a PM Table from the list please.','2014-01-15') , -( 'LABEL','ID_CONFIRM_DELETE_PM_TABLE','en','Do you want to delete selected tables?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_PM_TABLE','en','Do you want to delete the selected tables?','2017-04-21') , ( 'LABEL','ID_TITLE_START_CASE','en','Start Case','2014-01-15') , ( 'LABEL','ID_STARTING_NEW_CASE','en','Starting new case','2014-01-15') , ( 'LABEL','ID_ERROR_CREATING_NEW_CASE','en','Error creating a new Case','2014-01-15') , @@ -2515,7 +2518,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_CHECK_ALL','en','Check All','2014-01-15') , ( 'LABEL','ID_UN_CHECK_ALL','en','Un-Check All','2014-01-15') , ( 'LABEL','ID_SELECT_FIRST_ROW','en','First select a ROW from the list','2014-01-15') , -( 'LABEL','ID_MSG_CONFIRM_DELETE_ROW','en','Do you want to delete selected row?','2014-01-15') , +( 'LABEL','ID_MSG_CONFIRM_DELETE_ROW','en','Do you want to delete the selected row?','2017-04-21') , ( 'LABEL','ID_SENT_BY','en','Sent By','2014-01-15') , ( 'LABEL','ID_CURRENT_USER','en','Current User','2014-01-15') , ( 'LABEL','ID_LAST_MODIFY','en','Last Modified','2017-02-21') , @@ -2678,7 +2681,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_DEPARTMENT_EXISTS','en','Department name already exists.','2014-01-15') , ( 'LABEL','ID_DEPARTMENT_SUCCESS_UPDATE','en','Department has been updated correctly.','2014-01-15') , ( 'LABEL','ID_EDIT_DEPARTMENT','en','Edit Department','2014-01-15') , -( 'LABEL','ID_CONFIRM_DELETE_DEPARTMENT','en','Do you want to delete selected department?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_DEPARTMENT','en','Do you want to delete the selected department?','2017-04-21') , ( 'LABEL','ID_DEPARTMENT_SUCCESS_DELETE','en','Department has been deleted correctly.','2014-01-15') , ( 'LABEL','ID_MSG_CANNOT_DELETE_DEPARTMENT','en','The department cannot be deleted while it has assigned users.','2014-10-21') , ( 'LABEL','ID_MANAGER','en','Manager','2014-01-15') , @@ -2693,7 +2696,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_CATEGORY_SUCCESS_UPDATE','en','Process category has been updated correctly.','2014-01-15') , ( 'LABEL','ID_CATEGORY_SUCCESS_DELETE','en','Process category has been deleted correctly.','2014-01-15') , ( 'LABEL','ID_MSG_CANNOT_DELETE_CATEGORY','en','The category cannot be deleted while it is still assigned to processes.','2014-10-21') , -( 'LABEL','ID_CONFIRM_DELETE_CATEGORY','en','Do you want to delete selected category?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_CATEGORY','en','Do you want to delete the selected category?','2017-04-21') , ( 'LABEL','ID_GROUP_USERS','en','Group or Users','2014-01-15') , ( 'LABEL','ID_DOWNLOADING_FILE','en','Downloading file','2014-01-15') , ( 'LABEL','IMPORT_PROCESS_OVERWRITING','en','Update the current process, overwriting all tasks and steps','2014-01-15') , @@ -2819,7 +2822,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_AUTHENTICATION_SUCCESS_DELETE','en','Authentication source has been deleted correctly.','2014-01-15') , ( 'LABEL','ID_VARIABLES_CASE_PRIORITY','en','Variable for Case priority','2014-01-15') , ( 'LABEL','ID_START_TASK','en','Starting Task','2014-01-15') , -( 'LABEL','ID_CONFIRM_DELETE_AUTHENTICATION','en','Do you want to delete selected authentication source?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_AUTHENTICATION','en','Do you want to delete the selected authentication source?','2017-04-21') , ( 'LABEL','ID_ASSIGNMENT_RULES','en','Assignment Rules','2014-01-15') , ( 'LABEL','ID_CASES_ASSIGNED_BY','en','Cases to be Assigned by','2014-01-15') , ( 'LABEL','ID_CYCLIC_ASSIGNMENT','en','Cyclic Assignment','2014-01-15') , @@ -2951,8 +2954,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','MIME_DES_DOC','en','Word Document','2014-01-15') , ( 'LABEL','MIME_DES_XLS','en','Excel Document','2014-01-15') , ( 'LABEL','MIME_DES_RTF','en','Rich Text File','2014-01-15') , -( 'LABEL','ID_CONFIRM_DELETE_CALENDAR','en','Do you want to delete selected calendar?','2014-01-15') , -( 'LABEL','ID_CALENDAR_SUCCESS_DELETE','en','Calendar has been deleted correctly.','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_CALENDAR','en','Do you want to delete the selected calendar?','2014-01-15') , +( 'LABEL','ID_CALENDAR_SUCCESS_DELETE','en','Calendar has been deleted correctly.','2017-04-21') , ( 'LABEL','ID_MSG_CANNOT_DELETE_CALENDAR','en','The calendar cannot be deleted while it has assignations','2014-10-21') , ( 'LABEL','ID_REMOVED_SESSION_FILES','en','Older session files has been removed','2014-01-15') , ( 'LABEL','ID_NO_OLDER_SESSION_FILES','en','There are no older session files','2014-01-15') , @@ -3039,7 +3042,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_INPUT_DOC_SUCCESS_NEW','en','Input Document has been created correctly.','2014-01-15') , ( 'LABEL','ID_INPUT_DOC_SUCCESS_UPDATE','en','Input Document has been updated correctly.','2014-01-15') , ( 'LABEL','ID_INPUT_DOC_SUCCESS_DELETE','en','Input Document has been deleted correctly.','2014-01-15') , -( 'LABEL','ID_CONFIRM_DELETE_INPUT_DOC','en','Do you want to delete selected Input Document?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_INPUT_DOC','en','Do you want to delete the selected Input Document?','2017-04-21') , ( 'LABEL','ID_MSG_CANNOT_DELETE_INPUT_DOC','en','Input Document cannot be deleted while has assigned tasks.','2014-01-15') , ( 'LABEL','ID_SOME_FIELDS_REQUIRED','en','Some Fields are required.','2014-01-15') , ( 'LABEL','ID_INPUT_DOC_TITLE_REQUIRED','en','Input Document Title is required.','2014-01-15') , @@ -3215,7 +3218,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ( 'LABEL','ID_NULL','en','Null','2014-01-15') , ( 'LABEL','ID_TABLES_TO_EXPORT','en','Tables To Export','2014-01-15') , ( 'LABEL','ID_PMTABLES_NOTICE_EXPORT','en','From each table select at least one Schema/Data to export.','2014-10-21') , -( 'LABEL','ID_CONFIRM_DELETE_SKIN','en','Do you want to delete selected skin?','2014-01-15') , +( 'LABEL','ID_CONFIRM_DELETE_SKIN','en','Do you want to delete the selected skin?','2017-04-21') , ( 'LABEL','ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION','en','A note has been added to the case.','2014-10-21') , ( 'LABEL','ID_MSG_CANNOT_EXPORT_DEFAULT_SKIN','en','Default skin can''t be exported. Instead create new one based on default','2014-01-15') , ( 'LABEL','ID_MSG_CANNOT_EXPORT_SKIN','en','Can''t export skin. Server Error','2014-01-15') , diff --git a/workflow/engine/methods/cases/proxyCasesList.php b/workflow/engine/methods/cases/proxyCasesList.php index 48a60a32a..7f728ff43 100644 --- a/workflow/engine/methods/cases/proxyCasesList.php +++ b/workflow/engine/methods/cases/proxyCasesList.php @@ -4,7 +4,7 @@ if (!isset($_SESSION['USER_LOGGED'])) { $responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN'); $responseObject->success = true; $responseObject->lostSession = true; - print G::json_encode( $responseObject ); + print G::json_encode($responseObject); die(); } @@ -15,29 +15,29 @@ $_REQUEST = $filter->xssFilterHard($_REQUEST); $_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']); //Getting the extJs parameters -$callback = isset( $_REQUEST["callback"] ) ? $_REQUEST["callback"] : "stcCallback1001"; +$callback = isset($_REQUEST["callback"]) ? $_REQUEST["callback"] : "stcCallback1001"; //This default value was defined in casesList.js -$dir = isset( $_REQUEST["dir"] ) ? $_REQUEST["dir"] : "DESC"; +$dir = isset($_REQUEST["dir"]) ? $_REQUEST["dir"] : "DESC"; //This default value was defined in casesList.js -$sort = isset( $_REQUEST["sort"] ) ? $_REQUEST["sort"] : "APP_NUMBER"; -$start = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : "0"; -$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : "25"; -$filter = isset( $_REQUEST["filter"] ) ? $_REQUEST["filter"] : ""; -$process = isset( $_REQUEST["process"] ) ? $_REQUEST["process"] : ""; -$category = isset( $_REQUEST["category"] ) ? $_REQUEST["category"] : ""; -$status = isset( $_REQUEST["status"] ) ? strtoupper( $_REQUEST["status"] ) : ""; -$filterStatus = isset( $_REQUEST["filterStatus"] ) ? strtoupper( $_REQUEST["filterStatus"] ) : ""; -$user = isset( $_REQUEST["user"] ) ? $_REQUEST["user"] : ""; -$search = isset( $_REQUEST["search"] ) ? $_REQUEST["search"] : ""; -$action = isset( $_GET["action"] ) ? $_GET["action"] : (isset( $_REQUEST["action"] ) ? $_REQUEST["action"] : "todo"); -$type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_REQUEST["type"] ) ? $_REQUEST["type"] : "extjs"); -$dateFrom = isset( $_REQUEST["dateFrom"] ) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : ""; -$dateTo = isset( $_REQUEST["dateTo"] ) ? substr( $_REQUEST["dateTo"], 0, 10 ) : ""; -$first = isset( $_REQUEST["first"] ) ? true : false; -$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')? +$sort = isset($_REQUEST["sort"]) ? $_REQUEST["sort"] : "APP_NUMBER"; +$start = isset($_REQUEST["start"]) ? $_REQUEST["start"] : "0"; +$limit = isset($_REQUEST["limit"]) ? $_REQUEST["limit"] : "25"; +$filter = isset($_REQUEST["filter"]) ? $_REQUEST["filter"] : ""; +$process = isset($_REQUEST["process"]) ? $_REQUEST["process"] : ""; +$category = isset($_REQUEST["category"]) ? $_REQUEST["category"] : ""; +$status = isset($_REQUEST["status"]) ? strtoupper($_REQUEST["status"]) : ""; +$filterStatus = isset($_REQUEST["filterStatus"]) ? strtoupper($_REQUEST["filterStatus"]) : ""; +$user = isset($_REQUEST["user"]) ? $_REQUEST["user"] : ""; +$search = isset($_REQUEST["search"]) ? $_REQUEST["search"] : ""; +$action = isset($_GET["action"]) ? $_GET["action"] : (isset($_REQUEST["action"]) ? $_REQUEST["action"] : "todo"); +$type = isset($_GET["type"]) ? $_GET["type"] : (isset($_REQUEST["type"]) ? $_REQUEST["type"] : "extjs"); +$dateFrom = isset($_REQUEST["dateFrom"]) ? substr($_REQUEST["dateFrom"], 0, 10) : ""; +$dateTo = isset($_REQUEST["dateTo"]) ? substr($_REQUEST["dateTo"], 0, 10) : ""; +$first = isset($_REQUEST["first"]) ? true : false; +$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '') ? $_REQUEST['openApplicationUid'] : null; -$search = (!is_null($openApplicationUid))? $openApplicationUid : $search; +$search = (!is_null($openApplicationUid)) ? $openApplicationUid : $search; if ($sort == 'CASE_SUMMARY' || $sort == 'CASE_NOTES_COUNT') { $sort = 'APP_NUMBER';//DEFAULT VALUE @@ -47,9 +47,8 @@ if ($sort == 'APP_STATUS_LABEL') { } try { - $userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "")? $_SESSION["USER_LOGGED"] : null; + $userUid = (isset($_SESSION["USER_LOGGED"]) && $_SESSION["USER_LOGGED"] != "") ? $_SESSION["USER_LOGGED"] : null; $result = ""; - $solrEnabled = false; switch ($action) { case "search": @@ -59,60 +58,19 @@ try { $result['data'] = array(); $result = G::json_encode($result); echo $result; - return ; + return; } - $user = ($user == "CURRENT_USER")? $userUid : $user; + $user = ($user == "CURRENT_USER") ? $userUid : $user; $userUid = $user; break; default: break; } - if (( - $action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" || - $action == "selfservice" || $action == "unassigned" || $action == "search" - ) && - (($solrConf = System::solrEnv()) !== false) - ) { - G::LoadClass("AppSolr"); + G::LoadClass("applications"); + $apps = new Applications(); - $ApplicationSolrIndex = new AppSolr( - $solrConf["solr_enabled"], - $solrConf["solr_host"], - $solrConf["solr_instance"] - ); - - if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) { - //Check if there are missing records to reindex and reindex them - $ApplicationSolrIndex->synchronizePendingApplications(); - $solrEnabled = true; - } else{ - $solrEnabled = false; - } - } - - if ($solrEnabled) { - $data = $ApplicationSolrIndex->getAppGridData( - $userUid, - $start, - $limit, - $action, - $filter, - $search, - $process, - $status, - $type, - $dateFrom, - $dateTo, - $callback, - $dir, - $sort, - $category - ); - } else { - G::LoadClass("applications"); - - $apps = new Applications(); + if ($action == 'search') { $data = $apps->searchAll( $userUid, $start, @@ -126,7 +84,26 @@ try { $dateFrom, $dateTo ); + } else { + $data = $apps->getAll( + $userUid, + $start, + $limit, + $action, + $filter, + $search, + $process, + $filterStatus, + $type, + $dateFrom, + $dateTo, + $callback, + $dir, + (strpos($sort, ".") !== false) ? $sort : "APP_CACHE_VIEW." . $sort, + $category + ); } + $data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']); $result = G::json_encode($data); echo $result; diff --git a/workflow/engine/methods/setup/appCacheViewAjax.php b/workflow/engine/methods/setup/appCacheViewAjax.php index 454f084f7..4c6f758d0 100644 --- a/workflow/engine/methods/setup/appCacheViewAjax.php +++ b/workflow/engine/methods/setup/appCacheViewAjax.php @@ -165,16 +165,6 @@ switch ($request) { } else { $result->info[] = array('name' => 'Error', 'value' => $res['msg']); } - - $res = $appCache->setSuperForUser($currentUser); - if (!isset($res['error'])) { - $result->info[] = array('name' => G::LoadTranslation('ID_SETTING_SUPER'), 'value' => G::LoadTranslation('ID_SUCCESSFULLY')); - } else { - $result->error = true; - $result->errorMsg = $res['msg']; - } - $currentUserIsSuper = true; - } //now check if table APPCACHEVIEW exists, and it have correct number of fields, etc. diff --git a/workflow/engine/methods/setup/language_Ajax.php b/workflow/engine/methods/setup/language_Ajax.php index 820c94b1c..b209f2ec5 100644 --- a/workflow/engine/methods/setup/language_Ajax.php +++ b/workflow/engine/methods/setup/language_Ajax.php @@ -153,27 +153,27 @@ try { $oDataset->next(); $aRow = $oDataset->getRow(); - if($locale != "en"){ //Default Lengage 'en' - if($locale != SYS_LANG){ //Current lenguage - //THERE IS NO ANY CASE STARTED FROM THES LANGUAGE - if ($aRow[0] == 0) { //so we can delete this language - try { - Content::removeLanguageContent( $locale ); - $trn->removeTranslationEnvironment( $locale ); - echo G::LoadTranslation( 'ID_LANGUAGE_DELETED_SUCCESSFULLY' ); - } catch (Exception $e) { - $token = strtotime("now"); + if ($locale != "en") { //Default Language 'en' + if ($locale != SYS_LANG) { //Current Language + //THERE IS NO ANY CASE STARTED FROM THIS LANGUAGE + if (empty($aRow)) { //so we can delete this language + try { + Content::removeLanguageContent($locale); + $trn->removeTranslationEnvironment($locale); + echo G::LoadTranslation('ID_LANGUAGE_DELETED_SUCCESSFULLY'); + } catch (Exception $e) { + $token = strtotime("now"); PMException::registerErrorLog($e, $token); - G::outRes( G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token)) ); - } - } else { - echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE' ) ); - } - } else { - echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_CURRENTLY' ) ); - } + G::outRes(G::LoadTranslation("ID_EXCEPTION_LOG_INTERFAZ", array($token))); + } + } else { + echo str_replace('{0}', $aRow['APP_TITLE'], G::LoadTranslation('ID_LANGUAGE_CANT_DELETE')); + } + } else { + echo str_replace('{0}', $aRow['APP_TITLE'], G::LoadTranslation('ID_LANGUAGE_CANT_DELETE_CURRENTLY')); + } } else { - echo str_replace( '{0}', $aRow[0], G::LoadTranslation( 'ID_LANGUAGE_CANT_DELETE_DEFAULT' ) ); + echo str_replace('{0}', $aRow['APP_TITLE'], G::LoadTranslation('ID_LANGUAGE_CANT_DELETE_DEFAULT')); } break; } diff --git a/workflow/engine/methods/users/users_Ajax.php b/workflow/engine/methods/users/users_Ajax.php index 5052db1cb..6e3961caf 100644 --- a/workflow/engine/methods/users/users_Ajax.php +++ b/workflow/engine/methods/users/users_Ajax.php @@ -179,17 +179,23 @@ try { case 'canDeleteUser': G::LoadClass('case'); $oProcessMap = new Cases(); - $USR_UID = $_POST['uUID']; + $userUid = $_POST['uUID']; $total = 0; $history = 0; - $c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID); + $c = $oProcessMap->getCriteriaUsersCases('TO_DO', $userUid); $total += ApplicationPeer::doCount($c); - $c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID); + $c = $oProcessMap->getCriteriaUsersCases('DRAFT', $userUid); $total += ApplicationPeer::doCount($c); - $c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID); + $c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $userUid); $history += ApplicationPeer::doCount($c); - $c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID); + $c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $userUid); $history += ApplicationPeer::doCount($c); + //Check if the user is configured in Web Entry + if ($total === 0) { + $webEntry = new \ProcessMaker\BusinessModel\WebEntryEvent(); + $total = $webEntry->getWebEntryRelatedToUser($userUid); + } + $response = '{success: true, candelete: '; $response .= ($total > 0) ? 'false' : 'true'; $response .= ', hashistory: '; diff --git a/workflow/engine/skinEngine/base/baseCss/ext-all-notheme.css b/workflow/engine/skinEngine/base/baseCss/ext-all-notheme.css index 7c45d7a3b..a76ba2dd0 100644 --- a/workflow/engine/skinEngine/base/baseCss/ext-all-notheme.css +++ b/workflow/engine/skinEngine/base/baseCss/ext-all-notheme.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/base/baseCss/ext-all.css b/workflow/engine/skinEngine/base/baseCss/ext-all.css index b3c577282..d6aab37ab 100644 --- a/workflow/engine/skinEngine/base/baseCss/ext-all.css +++ b/workflow/engine/skinEngine/base/baseCss/ext-all.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/neoclassic/baseCss/ext-all-notheme.css b/workflow/engine/skinEngine/neoclassic/baseCss/ext-all-notheme.css index bcaacfddb..bdbfeeadf 100644 --- a/workflow/engine/skinEngine/neoclassic/baseCss/ext-all-notheme.css +++ b/workflow/engine/skinEngine/neoclassic/baseCss/ext-all-notheme.css @@ -1121,7 +1121,7 @@ textarea { position: relative; left: 0; top: 0; - text-align: left; + text-align: inherit; zoom: 1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/neoclassic/baseCss/ext-all.css b/workflow/engine/skinEngine/neoclassic/baseCss/ext-all.css index 6245c1833..aa657b4ba 100644 --- a/workflow/engine/skinEngine/neoclassic/baseCss/ext-all.css +++ b/workflow/engine/skinEngine/neoclassic/baseCss/ext-all.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/neoclassic/css/form.css b/workflow/engine/skinEngine/neoclassic/css/form.css index 27cc3887a..41e39ae91 100644 --- a/workflow/engine/skinEngine/neoclassic/css/form.css +++ b/workflow/engine/skinEngine/neoclassic/css/form.css @@ -293,7 +293,7 @@ INPUT { background-color: black; left: 0px; top: 0px; - height:100% !important; + height:auto% !important; } .panel_iframe___processmaker { width: 100%; diff --git a/workflow/engine/skinEngine/simplified/baseCss/ext-all-notheme.css b/workflow/engine/skinEngine/simplified/baseCss/ext-all-notheme.css index 01839b7c5..2cb9374b3 100644 --- a/workflow/engine/skinEngine/simplified/baseCss/ext-all-notheme.css +++ b/workflow/engine/skinEngine/simplified/baseCss/ext-all-notheme.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/simplified/baseCss/ext-all.css b/workflow/engine/skinEngine/simplified/baseCss/ext-all.css index b3c577282..d6aab37ab 100644 --- a/workflow/engine/skinEngine/simplified/baseCss/ext-all.css +++ b/workflow/engine/skinEngine/simplified/baseCss/ext-all.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/uxmodern/baseCss/ext-all-notheme.css b/workflow/engine/skinEngine/uxmodern/baseCss/ext-all-notheme.css index 7c45d7a3b..a76ba2dd0 100644 --- a/workflow/engine/skinEngine/uxmodern/baseCss/ext-all-notheme.css +++ b/workflow/engine/skinEngine/uxmodern/baseCss/ext-all-notheme.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/uxmodern/baseCss/ext-all.css b/workflow/engine/skinEngine/uxmodern/baseCss/ext-all.css index 24e251a92..6fb506092 100644 --- a/workflow/engine/skinEngine/uxmodern/baseCss/ext-all.css +++ b/workflow/engine/skinEngine/uxmodern/baseCss/ext-all.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/uxs/baseCss/ext-all-notheme.css b/workflow/engine/skinEngine/uxs/baseCss/ext-all-notheme.css index 01839b7c5..2cb9374b3 100644 --- a/workflow/engine/skinEngine/uxs/baseCss/ext-all-notheme.css +++ b/workflow/engine/skinEngine/uxs/baseCss/ext-all-notheme.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/skinEngine/uxs/baseCss/ext-all.css b/workflow/engine/skinEngine/uxs/baseCss/ext-all.css index b3c577282..d6aab37ab 100644 --- a/workflow/engine/skinEngine/uxs/baseCss/ext-all.css +++ b/workflow/engine/skinEngine/uxs/baseCss/ext-all.css @@ -979,8 +979,9 @@ textarea { .x-form-field-wrap { position:relative; - left:0;top:0; - text-align: left; + left:0; + top:0; + text-align: inherit; zoom:1; white-space: nowrap; } diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php index d75a6667d..df6d214ab 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases.php @@ -233,7 +233,6 @@ class Cases } G::LoadClass("applications"); - $solrEnabled = false; $userUid = $dataList["userId"]; $callback = isset( $dataList["callback"] ) ? $dataList["callback"] : "stcCallback1001"; $dir = isset( $dataList["dir"] ) ? $dataList["dir"] : "DESC"; @@ -327,70 +326,30 @@ class Cases } } - if (( - $action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" || - $action == "selfservice" || $action == "unassigned" || $action == "search" - ) && - (($solrConf = \System::solrEnv()) !== false) - ) { - G::LoadClass("AppSolr"); + G::LoadClass("applications"); + $apps = new \Applications(); + $result = $apps->getAll( + $userUid, + $start, + $limit, + $action, + $filter, + $search, + $process, + $status, + $type, + $dateFrom, + $dateTo, + $callback, + $dir, + (strpos($sort, ".") !== false) ? $sort : "APP_CACHE_VIEW." . $sort, + $category, + true, + $paged, + $newerThan, + $oldestThan + ); - $ApplicationSolrIndex = new \AppSolr( - $solrConf["solr_enabled"], - $solrConf["solr_host"], - $solrConf["solr_instance"] - ); - - if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) { - //Check if there are missing records to reindex and reindex them - $ApplicationSolrIndex->synchronizePendingApplications(); - $solrEnabled = true; - } - } - - if ($solrEnabled) { - $result = $ApplicationSolrIndex->getAppGridData( - $userUid, - $start, - $limit, - $action, - $filter, - $search, - $process, - $status, - $type, - $dateFrom, - $dateTo, - $callback, - $dir, - $sort, - $category - ); - } else { - G::LoadClass("applications"); - $apps = new \Applications(); - $result = $apps->getAll( - $userUid, - $start, - $limit, - $action, - $filter, - $search, - $process, - $status, - $type, - $dateFrom, - $dateTo, - $callback, - $dir, - (strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort, - $category, - true, - $paged, - $newerThan, - $oldestThan - ); - } if (!empty($result['data'])) { foreach ($result['data'] as &$value) { $value = array_change_key_case($value, CASE_LOWER); diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php index 2823a9172..d090fb27f 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Light.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Light.php @@ -78,6 +78,9 @@ class Light $tempTreeChild['processId'] = $processInfoChild['pro_uid']; $tempTreeChild['taskId'] = $processInfoChild['uid']; list($tempTreeChild['offlineEnabled'], $tempTreeChild['autoRoot']) = $task->getColumnValues($processInfoChild['pro_uid'], $processInfoChild['uid'], array('TAS_OFFLINE', 'TAS_AUTO_ROOT')); + //Add process category + $tempTreeChild['categoryName'] = $processInfoChild['catname']; + $tempTreeChild['categoryId'] = $processInfoChild['cat']; $forms = $task->getSteps($processInfoChild['uid']); $newForm = array(); $c = 0; diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php index 6dffa896b..23b8f8b03 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php @@ -996,4 +996,24 @@ class WebEntryEvent throw $e; } } + + /** + * This function verify if a user $userUid was configure in a Web Entry and return the total of records + * + * @param string $userUid uid of a user + * + * return integer $total + */ + public function getWebEntryRelatedToUser($userUid) + { + try { + //Get data + $criteria = $this->getWebEntryEventCriteria(); + $criteria->add(\WebEntryEventPeer::USR_UID, $userUid, \Criteria::EQUAL); + $total = \WebEntryEventPeer::doCount($criteria); + return $total; + } catch (\Exception $e) { + throw $e; + } + } } diff --git a/workflow/engine/src/ProcessMaker/Importer/Importer.php b/workflow/engine/src/ProcessMaker/Importer/Importer.php index 701f3e326..f3d946fa5 100644 --- a/workflow/engine/src/ProcessMaker/Importer/Importer.php +++ b/workflow/engine/src/ProcessMaker/Importer/Importer.php @@ -14,6 +14,7 @@ abstract class Importer protected $filename = ""; protected $saveDir = ""; protected $metadata = array(); + protected $prjCreateUser = ''; /** * Title of the process before being updated/deleted. * @var string @@ -494,6 +495,7 @@ abstract class Importer $project["diagrams"] = array($diagram); $project["prj_author"] = isset($this->data["usr_uid"])? $this->data["usr_uid"]: "00000000000000000000000000000001"; $project["process"] = $tables["process"][0]; + $project["prjCreateUser"] = $this->prjCreateUser; return Adapter\BpmnWorkflow::createFromStruct($project, $generateUid); } @@ -761,7 +763,7 @@ abstract class Importer } } - public function saveAs($prj_uid, $prj_name, $prj_description, $prj_category) + public function saveAs($prj_uid, $prj_name, $prj_description, $prj_category, $prj_user = '') { try { $exporter = new \ProcessMaker\Exporter\XmlExporter($prj_uid); @@ -779,6 +781,7 @@ abstract class Importer $this->setSourceFile($outputFilename); $this->prepare(); + $this->prjCreateUser = $prj_user; $this->importData["tables"]["bpmn"]["project"][0]["prj_name"] = $prj_name; $this->importData["tables"]["bpmn"]["project"][0]["prj_description"] = $prj_description; $this->importData["tables"]["bpmn"]["diagram"][0]["dia_name"] = $prj_name; diff --git a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php index 39b656dcc..1205fa62b 100644 --- a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php @@ -94,6 +94,10 @@ class BpmnWorkflow extends Project\Bpmn $wpData["PRO_STATUS"] = $data["PRO_STATUS"]; } + if (array_key_exists("PRO_CREATE_USER", $data)) { + $wpData["PRO_CREATE_USER"] = $data["PRO_CREATE_USER"]; + } + $this->wp = new Project\Workflow(); $this->wp->create($wpData); @@ -1318,6 +1322,10 @@ class BpmnWorkflow extends Project\Bpmn $data["PRO_STATUS"] = $projectData['pro_status']; } + if (isset($projectData['prjCreateUser'])){ + $data["PRO_CREATE_USER"] = $projectData['prjCreateUser']; + } + $bwp->create($data); $diagramData = $processData = array(); diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Project.php b/workflow/engine/src/ProcessMaker/Services/Api/Project.php index 6c080741c..78114a200 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Project.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project.php @@ -221,7 +221,7 @@ class Project extends Api public function doSaveAs($prj_uid, $prj_name, $prj_description = null, $prj_category = null) { $importer = new \ProcessMaker\Importer\XmlImporter(); - return $importer->saveAs($prj_uid, $prj_name, $prj_description, $prj_category); + return $importer->saveAs($prj_uid, $prj_name, $prj_description, $prj_category, $this->getUserId()); } /** diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php b/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php index 74af56924..5e8231b04 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Project/OutputDocuments.php @@ -78,10 +78,10 @@ class OutputDocuments extends Api * * @param string $prjUid {@min 32} {@max 32} * @param string $outputDocumentUid {@min 32} {@max 32} - * @param OutputDocumentStructure $request_data + * @param array $request_data * */ - public function doPutProjectOutputDocument($prjUid, $outputDocumentUid, OutputDocumentStructure $request_data) + public function doPutProjectOutputDocument($prjUid, $outputDocumentUid, $request_data) { try { $request_data = (array)($request_data); diff --git a/workflow/engine/templates/admin/system.js b/workflow/engine/templates/admin/system.js index 0b6879df7..7dc38aa8e 100644 --- a/workflow/engine/templates/admin/system.js +++ b/workflow/engine/templates/admin/system.js @@ -85,32 +85,6 @@ Ext.onReady(function(){ cmbTimeZone.setValue(sysConf.time_zone); - txtExpirationYear = new Ext.form.TextField({ - xtype: 'numberfield', - id : 'expiration_year', - name : 'expiration_year', - fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'), - allowBlank: false, - allowNegative: false, - value: 1, - maxlength: 15, - minValue: 1, - validator: function(value){ - if(value > 0) { - return true; - } else { - PMExt.error( _('ID_ERROR'), _('ID_INVALID_VALUE_EXPECTING_POSITIVE_INTEGER', _('ID_DEFAULT_EXPIRATION_YEAR'))); - return false; - } - }, - listeners:{ - change: function(){ - changeSettings(); - } - } - }); - txtExpirationYear.setValue(sysConf.expiration_year); - saveButton = new Ext.Action({ text : _('ID_SAVE_SETTINGS'), disabled : true, @@ -118,38 +92,56 @@ Ext.onReady(function(){ }); xfieldsUp = new Ext.form.FieldSet({ - title: _('ID_SYSTEM_SETTINGS'), - items : [ - cmbTimeZone, - { - xtype: 'numberfield', - id : 'memory_limit', - name : 'memory_limit', - fieldLabel: _('ID_MEMORY_LIMIT'), - allowBlank: false, - autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, - value: sysConf.memory_limit, - listeners:{ - change: function(){ - changeSettings(); + title: _('ID_SYSTEM_SETTINGS'), + items: [ + cmbTimeZone, + { + xtype: 'numberfield', + id: 'memory_limit', + name: 'memory_limit', + fieldLabel: _('ID_MEMORY_LIMIT'), + allowBlank: false, + allowDecimals: false, + minValue: -1, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, + value: sysConf.memory_limit, + listeners: { + change: function () { + changeSettings(); + } + } + }, { + xtype: 'numberfield', + id: 'max_life_time', + name: 'max_life_time', + fieldLabel: _('ID_MAX_LIFETIME'), + allowNegative: false, + allowDecimals: false, + autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15}, + value: sysConf.session_gc_maxlifetime, + listeners: { + change: function () { + changeSettings(); + } + } + }, { + xtype: 'numberfield', + id: 'expiration_year', + name: 'expiration_year', + fieldLabel: _('ID_DEFAULT_EXPIRATION_YEAR'), + allowBlank: false, + allowNegative: false, + allowDecimals: false, + value: sysConf.expiration_year, + maxlength: 15, + minValue: 1, + listeners: { + change: function () { + changeSettings(); + } + } } - } - }, { - xtype: 'numberfield', - id : 'max_life_time', - name : 'max_life_time', - fieldLabel: _('ID_MAX_LIFETIME'), - // allowBlank: false, - autoCreate: {tag: "input", type: "text", autocomplete: "off", maxlength: 15 }, - value: sysConf.session_gc_maxlifetime, - listeners:{ - change: function(){ - changeSettings(); - } - } - } - ,txtExpirationYear - ] + ] }); xfieldsBelow = new Ext.form.FieldSet({ diff --git a/workflow/engine/templates/installer/installer_cards.js b/workflow/engine/templates/installer/installer_cards.js index 94409b8e1..a754ce411 100644 --- a/workflow/engine/templates/installer/installer_cards.js +++ b/workflow/engine/templates/installer/installer_cards.js @@ -744,6 +744,10 @@ Ext.onReady(function(){ id: 'adminPassword', enableKeyEvents: true, allowBlank: false, + validator: function (v) { + v = v.trim(); + return !/^\s+$/.test(v); + }, listeners: {keyup: function() { wizard.onClientValidation(4, false); }} @@ -755,6 +759,10 @@ Ext.onReady(function(){ id : 'confirmPassword', enableKeyEvents: true, allowBlank: false, + validator: function (v) { + v = v.trim(); + return !/^\s+$/.test(v.trim()); + }, listeners: {keyup: function() { wizard.onClientValidation(4, false); }} diff --git a/workflow/engine/templates/processes/webentryPost.tpl b/workflow/engine/templates/processes/webentryPost.tpl index 85c80bee2..079bf370e 100644 --- a/workflow/engine/templates/processes/webentryPost.tpl +++ b/workflow/engine/templates/processes/webentryPost.tpl @@ -153,7 +153,7 @@ try { $result = ws_routeCase($caseId, 1); $assign = $result->message; - $aMessage["MESSAGE"] = "
Case created in ProcessMaker
Case Number: $caseNr
Case Id: $caseId
Case derivated to: $assign"; + $aMessage["MESSAGE"] = "
Case created in ProcessMaker
Case Number: $caseNr
Case Id: $caseId
Case routed to: $assign"; } else { $aMessage["MESSAGE"] = " An error occurred while the application was being processed.
diff --git a/workflow/engine/templates/services/login_getStarted.html b/workflow/engine/templates/services/login_getStarted.html index baac5bc14..243b00080 100644 --- a/workflow/engine/templates/services/login_getStarted.html +++ b/workflow/engine/templates/services/login_getStarted.html @@ -44,6 +44,7 @@ span.cMargLeft { padding-left: 20; } .cell2 { + vertical-align: middle; font-size: 13px; background: #fff; border-right: #fff 1px solid; @@ -95,8 +96,7 @@

Welcome to ProcessMaker


-

This new version features a new process designer based upon the Business Process Management Notation 2 standard. It offers a new form designer with flexible layouts for desktops, tablets and cellphones and a new REST API to remotely access ProcessMaker.

-

To get started, log in using the following credentials. You can change them later:

+

To get started log in using the following credentials:

Username: {name}
Password: {pass}

We suggest you follow our 7 easy videos to automate your workflow. You can see a demo of each step at http://www.processmaker.com/tutorials/

diff --git a/workflow/engine/templates/setup/newSite.js b/workflow/engine/templates/setup/newSite.js index 7306a1c56..8d08c7164 100644 --- a/workflow/engine/templates/setup/newSite.js +++ b/workflow/engine/templates/setup/newSite.js @@ -100,7 +100,11 @@ Ext.onReady(function(){ inputType:'password', value:'admin', width: 200, - allowBlank: false + allowBlank: false, + validator: function (v) { + v = v.trim(); + return !/^\s+$/.test(v); + } }, { id: 'NW_PASSWORD2', @@ -109,7 +113,11 @@ Ext.onReady(function(){ inputType:'password', value:'admin', width: 200, - allowBlank: false + allowBlank: false, + validator: function (v) { + v = v.trim(); + return !/^\s+$/.test(v); + } } ] }); @@ -173,11 +181,9 @@ Ext.onReady(function(){ aoDbRb =aoDbWf; aoDbRp =aoDbWf; nwUsername =formNewSite.getForm().findField('NW_USERNAME').getValue(); - nwPassword =formNewSite.getForm().findField('NW_PASSWORD').getValue(); - nwPassword2=formNewSite.getForm().findField('NW_PASSWORD2').getValue(); + nwPassword = formNewSite.getForm().findField('NW_PASSWORD').getValue().trim(); + nwPassword2 = formNewSite.getForm().findField('NW_PASSWORD2').getValue().trim(); aoDbDrop=formNewSite.getForm().findField('AO_DB_DROP').getValue(); - //Ext.getCmp('NW_TITLE').disable()=true; - //Ext.getCmp('NW_TITLE').readOnly = true; createNW(nwTitle, aoDbWf, aoDbRb, aoDbRp, nwUsername, nwPassword, nwPassword2); }, failure: function(f,a){ diff --git a/workflow/engine/templates/users/users.js b/workflow/engine/templates/users/users.js index 07d911864..38bd1a514 100644 --- a/workflow/engine/templates/users/users.js +++ b/workflow/engine/templates/users/users.js @@ -116,20 +116,6 @@ Ext.onReady(function () { width : 400 } -/* - ,{ - xtype: 'fileuploadfield', - id: 'USR_RESUME', - emptyText: _('ID_PLEASE_SELECT_FILE'), - fieldLabel: _('ID_RESUME'), - name: 'USR_RESUME', - buttonText: '', - width: 260, - buttonCfg:{ - iconCls: 'upload-icon' - } - } -*/ ] }); @@ -308,8 +294,9 @@ Ext.onReady(function () { var dateField = new Ext.form.DateField({ id : "USR_DUE_DATE", - fieldLabel : _("ID_EXPIRATION_DATE"), + fieldLabel : ' * ' + _("ID_EXPIRATION_DATE"), format : "Y-m-d", + allowBlank:false, editable : true, width : 120, value : (new Date().add(Date.YEAR, EXPIRATION_DATE)).format("Y-m-d") @@ -1205,8 +1192,8 @@ function validateUserName() { function userFrmEditSubmit() { - if (typeof(usertmp) != "undefined" && - usertmp.REPLACED_NAME == frmDetails.getForm().findField("USR_REPLACED_BY").getRawValue() + if (typeof(usertmp) !== "undefined" && + usertmp.REPLACED_NAME === frmDetails.getForm().findField("USR_REPLACED_BY").getRawValue() ) { frmDetails.getForm().findField("USR_REPLACED_BY").setValue(usertmp.USR_REPLACED_BY); frmDetails.getForm().findField("USR_REPLACED_BY").setRawValue(usertmp.REPLACED_NAME);