diff --git a/gulliver/js/form/core/form.js b/gulliver/js/form/core/form.js index 291487ced..aad196d0f 100755 --- a/gulliver/js/form/core/form.js +++ b/gulliver/js/form/core/form.js @@ -3908,13 +3908,15 @@ function dropDownSetOption(elem, arrayOption) function dynaFormChanged(frm) { for (var i1 = 0; i1 <= frm.elements.length - 1; i1++) { - if (frm.elements[i1].type == "text" && frm.elements[i1].value != frm.elements[i1].defaultValue) { - return true; + + if((frm.elements[i1].type=="radio" || frm.elements[i1].type=="checkbox") && (frm.elements[i1].checked!=frm.elements[i1].defaultChecked)) { + return true; } - - if (frm.elements[i1].type == "textarea" && frm.elements[i1].value != frm.elements[i1].defaultValue) { - return true; + + if((frm.elements[i1].type=="textarea" || frm.elements[i1].type=="text" || frm.elements[i1].type=="file") && (frm.elements[i1].value!=frm.elements[i1].defaultValue)) { + return true; } + if (frm.elements[i1].tagName.toLowerCase() == "select") { var selectDefaultValue = frm.elements[i1].value; diff --git a/gulliver/js/maborak/core/maborak.js b/gulliver/js/maborak/core/maborak.js index 8cc4f40d9..3e4091ab0 100644 --- a/gulliver/js/maborak/core/maborak.js +++ b/gulliver/js/maborak/core/maborak.js @@ -1281,8 +1281,8 @@ selectdd.innerHTML="";for(i=0;i<=arrayOption.options.length-1;i++){if(swOptGroup optionAux=document.createElement("option");optGroupAux.appendChild(optionAux);optionAux.value=arrayOption.options[i].key;optionAux.text=arrayOption.options[i].value;}else{optionAux=document.createElement("option");selectdd.appendChild(optionAux);optionAux.value=arrayOption.options[i].key;optionAux.text=arrayOption.options[i].value;}}} if(selectdd.options.length==0){selectdd.options[0]=new Option("","");}} function dynaFormChanged(frm) -{for(var i1=0;i1<=frm.elements.length-1;i1++){if(frm.elements[i1].type=="text"&&frm.elements[i1].value!=frm.elements[i1].defaultValue){return true;} -if(frm.elements[i1].type=="textarea"&&frm.elements[i1].value!=frm.elements[i1].defaultValue){return true;} +{for(var i1=0;i1<=frm.elements.length-1;i1++){if((frm.elements[i1].type=="radio"||frm.elements[i1].type=="checkbox")&&(frm.elements[i1].checked!=frm.elements[i1].defaultChecked)){return true;} +if((frm.elements[i1].type=="textarea"||frm.elements[i1].type=="text"||frm.elements[i1].type=="file")&&(frm.elements[i1].value!=frm.elements[i1].defaultValue)){return true;} if(frm.elements[i1].tagName.toLowerCase()=="select"){var selectDefaultValue=frm.elements[i1].value;for(var i2=0;i2<=frm.elements[i1].options.length-1;i2++){if(frm.elements[i1].options[i2].defaultSelected){selectDefaultValue=frm.elements[i1].options[i2].value;break;}} if(frm.elements[i1].value!=selectDefaultValue){return true;}}} return false;} diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 7550a46fe..1a50437b1 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -177,7 +177,7 @@ class G * getIpAddress * @return string $ip */ - public function getIpAddress () + public static function getIpAddress () { if (getenv( 'HTTP_CLIENT_IP' )) { $ip = getenv( 'HTTP_CLIENT_IP' ); diff --git a/gulliver/system/class.publisher.php b/gulliver/system/class.publisher.php index 1088b1014..a26b22f19 100755 --- a/gulliver/system/class.publisher.php +++ b/gulliver/system/class.publisher.php @@ -236,7 +236,7 @@ class Publisher break; case 'prompt': // Show Prompt only if there are no required fields can submit the form. - $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)",action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this),cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} return false;'; + $G_FORM->values['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'if (document.getElementById("' . $G_FORM->id . '")&&validateForm(document.getElementById(\'DynaformRequiredFields\').value)) {if(dynaFormChanged(document.getElementsByTagName(\'form\').item(0))) {new leimnud.module.app.confirm().make({label:"@G::LoadTranslation(ID_DYNAFORM_SAVE_CHANGES)", action:function(){document.getElementById("' . $G_FORM->id . '").submit();}.extend(this), cancel:function(){window.location = getField("DYN_FORWARD").href;}.extend(this)});return false;} else {window.location = getField("DYN_FORWARD").href;return false;}}return false;'; break; } } diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 1c97d03b4..f6596eebf 100755 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -854,6 +854,7 @@ class XmlForm_Field public function NSGridType ($show = false) { $igt = 'pm:gridtype="' . $this->gridFieldType . '"'; + if ($show) { return $igt; } else { @@ -891,7 +892,7 @@ class XmlForm_Field { $_outHint = ''; if ($this->hint != '' && $this->mode == 'edit') { - $_outHint = ' + $_outHint = ' '; } @@ -920,7 +921,7 @@ class XmlForm_Field_Title extends XmlForm_Field public function render ($value = null, &$owner = null) { $this->label = G::replaceDataField( $this->label, $owner->values ); - return 'name . ']\' name=\'form[' . $this->name . ']\' >' . $this->htmlentities( $this->label ) . ''; + return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; } /** @@ -955,7 +956,7 @@ class XmlForm_Field_Subtitle extends XmlForm_Field */ public function render ($value = null) { - return 'name . ']\' name=\'form[' . $this->name . ']\' >' . $this->htmlentities( $this->label ) . ''; + return 'name . ']\' name=\'form[' . $this->name . ']\' ' . $this->NSFieldType() . ' >' . $this->htmlentities( $this->label ) . ''; } /** @@ -1881,14 +1882,14 @@ class XmlForm_Field_Password extends XmlForm_Field if ($this->mode === 'edit') { if ($this->readOnly) { - return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>'; + return 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>'; } else { - $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\'/>'; + $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . '/>'; $html .= $this->renderHint(); return $html; } } elseif ($this->mode === 'view') { - $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' readOnly="readOnly"/>'; + $html = 'htmlentities( $value, ENT_COMPAT, 'utf-8' ) . '\' ' . $this->NSFieldType() . ' readOnly="readOnly"/>'; $html .= $this->htmlentities( str_repeat( '*', 10 ), ENT_COMPAT, 'utf-8' ); return $html; } else { @@ -1955,6 +1956,7 @@ class XmlForm_Field_Textarea extends XmlForm_Field $html .= 'style="' . $scrollStyle . '" wrap="' . $this->htmlentities( $this->wrap, ENT_QUOTES, 'UTF-8' ) . '" '; $html .= $this->NSDefaultValue() . ' '; $html .= $this->NSRequiredValue() . ' '; + $html .= $this->NSFieldType() . ' '; $html .= 'class="' . $className . '" >'; $html .= $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); $html .= ''; @@ -2627,7 +2629,7 @@ class XmlForm_Field_YesNo extends XmlForm_Field } } else { //VIEW MODE - $html .= ''; + $html .= ''; $html .= ($value === '0') ? G::LoadTranslation( 'ID_NO_VALUE' ) : G::LoadTranslation( 'ID_YES_VALUE' ); $html .= 'name . ']" '; @@ -2747,7 +2749,8 @@ class XmlForm_Field_Link extends XmlForm_Field $target = G::replaceDataField($this->target, $v); $html = "htmlentities($link, ENT_QUOTES, "utf-8") . "\""; - $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\""; + $html = $html . " id=\"form[$id]\" name=\"form[$id]\" pm:field=\"pm:field\" "; + $html .= $this->NSFieldType() . ' '; if ((strrpos($_SERVER['HTTP_USER_AGENT'], "Chrome") === false ? false : true) && trim($this->htmlentities($link, ENT_QUOTES, "utf-8")) === "#") { $html = $html . (($this->onclick) ? " onclick=\"" . htmlentities($onclick, ENT_QUOTES, "utf-8") . " return false;\"" : " onclick=\" return false;\""); } else { @@ -2903,8 +2906,7 @@ class XmlForm_Field_File extends XmlForm_Field $styleDisplay = "display: none;"; } - $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2; - + $html = $html1 . "name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" " .$this->NSFieldType(). " value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2; if (isset( $this->input ) && $this->input != null) { require_once ("classes/model/InputDocument.php"); @@ -3081,9 +3083,9 @@ class XmlForm_Field_Checkbox extends XmlForm_Field if ($this->mode === 'edit') { //$readOnly = isset ( $this->readOnly ) && $this->readOnly ? 'disabled' : ''; if ($this->labelOnRight) { - $res = "" . $this->label . ''; + $res = "NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly $disabled>" . $this->label . ''; } else { - $res = ""; + $res = "NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly $disabled/>"; } $res .= $this->renderHint(); @@ -3195,7 +3197,7 @@ class XmlForm_Field_Button extends XmlForm_Field $onclick = G::replaceDataField( $this->onclick, $owner->values ); $label = G::replaceDataField( $this->label, $owner->values ); if ($this->mode === 'edit') { - $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + $re = "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; return $re; } elseif ($this->mode === 'view') { return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='button' value=\"{$label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; @@ -3230,7 +3232,7 @@ class XmlForm_Field_Reset extends XmlForm_Field //return ''; // return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; if ($this->mode === 'edit') { - return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style}\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } elseif ($this->mode === 'view') { return "style};display:none\" $mode class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='reset' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } else { @@ -3266,7 +3268,7 @@ class XmlForm_Field_Submit extends XmlForm_Field if ($this->mode === 'edit') { // if ($this->readOnly) // return 'label .'\' disabled/>'; - return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; + return "style}\" class='module_app_button___gray {$this->className}' id=\"form[{$this->name}]\" " . $this->NSFieldType() . " name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; } elseif ($this->mode === 'view') { //return "style};display:none\" disabled='disabled' class='module_app_button___gray module_app_buttonDisabled___gray {$this->className}' id=\"form[{$this->name}]\" name=\"form[{$this->name}]\" type='submit' value=\"{$this->label}\" " . (($this->onclick) ? 'onclick="' . htmlentities ( $onclick, ENT_COMPAT, 'utf-8' ) . '"' : '') . " />"; //$sLinkNextStep = 'window.open("' . $owner->fields['__DYNAFORM_OPTIONS']->xmlMenu->values['NEXT_STEP'] . '", "_self");'; @@ -3300,7 +3302,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field public $sql = ''; public $sqlOption = array (); public $dependentFields = ''; - + public $gridFieldType = 'hidden'; /** * Function render * @@ -3326,7 +3328,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field } } if ($this->mode === 'edit') { - return ''; + return 'NSFieldType() . ' name="form[' . $this->name . ']" type=\'hidden\' value=\'' . $value . '\'/>'; } elseif ($this->mode === 'view') { //a button? who wants a hidden field be showed like a button?? very strange. return ''; @@ -3347,7 +3349,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field $result = array (); $r = 1; foreach ($values as $v) { - $result[] = ''; + $result[] = 'NSGridType() . ' value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" />'; $r ++; } @@ -3363,7 +3365,7 @@ class XmlForm_Field_Hidden extends XmlForm_Field */ public function renderTable ($value = '', $owner = null) { - return ''; + return ''; } } @@ -3644,7 +3646,7 @@ class XmlForm_Field_Listbox extends XmlForm_Field if ($this->width != '') { $itemWidth = 'style="width:' . $this->width . '"'; } - $html = 'NSFieldType() . ' name="form[' . $this->name . '][]" size="' . $this->size . '" ' . $itemWidth . ' ' . $this->NSFieldType() . '>'; foreach ($this->option as $optionName => $option) { $html .= ""; } @@ -3740,9 +3742,9 @@ class XmlForm_Field_RadioGroup extends XmlForm_Field $i = 0; foreach ($this->options as $optionName => $option) { if (isset( $this->linkType ) && ($this->linkType == 1 || $this->linkType == "1")) { - $html .= '' . $option . ''; + $html .= 'NSFieldType() . ' name="form[' . $this->name . ']" type="radio" value="' . $optionName . '" ' . (($optionName == $value) ? ' checked' : '') . '>' . $option . ''; } else { - $html .= ''; + $html .= 'NSFieldType() . ' name="form[' . $this->name . ']" type="radio" value="' . $optionName . '" ' . (($optionName == $value) ? ' checked' : '') . '>'; } if (++ $i == count( $this->options )) { $html .= '      ' . $this->renderHint(); @@ -3855,7 +3857,7 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field $i = 0; $html = ''; foreach ($this->options as $optionName => $option) { - $html .= "name . "][" . $optionName . "]\" name=\"form[" . $this->name . "][]\" value=\"" . $optionName . "\"" . (in_array( $optionName . "", $value ) ? "checked = \"checked\" " : "") . ">"; + $html .= "name . "][" . $optionName . "]\" " . $this->NSFieldType() . " name=\"form[" . $this->name . "][]\" value=\"" . $optionName . "\"" . (in_array( $optionName . "", $value ) ? "checked = \"checked\" " : "") . ">"; if (++ $i == count( $this->options )) { $html .= '      ' . $this->renderHint(); @@ -4413,7 +4415,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText if (trim($v) !== "") { $v = date( masktophp($mask, $v) ); } - $html = 'NSRequiredValue() . ' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" pm:required="' . $isRequired . '" style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" ' . $this->NSGridType() . '/>' . htmlentities( $v, ENT_COMPAT, 'utf-8' ); + $html = 'NSRequiredValue() .' class="module_app_input___gray" id="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" name="form[' . $owner->name . '][' . $r . '][' . $this->name . ']" type ="text" size="' . $this->size . '" maxlength="' . $this->maxLength . '" value="' . $this->htmlentities( $v, ENT_COMPAT, 'utf-8' ) . '" pm:required="' . $isRequired . '" style="display:none;' . htmlentities( $this->style, ENT_COMPAT, 'utf-8' ) . '" />' . htmlentities( $v, ENT_COMPAT, 'utf-8' ); } else { $id = 'form[' . $owner->name . '][' . $r . '][' . $this->name . ']'; $html = $this->__draw_widget( $id, $v, $owner, true ); @@ -4565,7 +4567,7 @@ class XmlForm_Field_Date extends XmlForm_Field_SimpleText } if ($this->editable != "0") { - $html = '' . '' . ' ' . '' . '' . ' ' . '' . ''; + $html = 'NSFieldType() . ' pm:required="' . $isRequired . '" id="' . $pID . '" name="' . $pID . '" pm:mask="' . $mask . '" pm:start="' . $startDate . '" pm:end="' . $endDate . '" pm:time="' . $Time . '" ' . $onchange . ' class="module_app_input___gray" size="' . $sizeend . '" value="' . $value . '" pm:defaultvalue="' . $defaultValue . '" />' . '' . ' ' . '' . '' . ' ' . '' . ''; } else { $html = '' . '' . ' ' . '' . '' . ' ' . '' . ''; } diff --git a/gulliver/thirdparty/phpmailer/class.phpmailer.php b/gulliver/thirdparty/phpmailer/class.phpmailer.php index 99c0d783a..1002df591 100755 --- a/gulliver/thirdparty/phpmailer/class.phpmailer.php +++ b/gulliver/thirdparty/phpmailer/class.phpmailer.php @@ -1148,6 +1148,9 @@ class PHPMailer { //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"! $l = true; if ($langcode != 'en') { //There is no English translation file + if (substr($langcode, 0, 2) == 'pt') { + $langcode = 'br'; + } $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php'; } $this->language = $PHPMAILER_LANG; @@ -2417,8 +2420,12 @@ class PHPMailer { * @return string */ protected function Lang($key) { + $lang = 'en'; if(count($this->language) < 1) { - $this->SetLanguage('en'); // set the default language + if (defined('SYS_LANG')) { + $lang = SYS_LANG; + } + $this->SetLanguage($lang); } if(isset($this->language[$key])) { diff --git a/gulliver/thirdparty/phpmailer/class.smtp.php b/gulliver/thirdparty/phpmailer/class.smtp.php index fdec2fdb9..3d4b9ce00 100755 --- a/gulliver/thirdparty/phpmailer/class.smtp.php +++ b/gulliver/thirdparty/phpmailer/class.smtp.php @@ -162,7 +162,7 @@ class SMTP { // make sure we are __not__ connected if($this->connected()) { // already connected, generate error - $this->error = array("error" => "Already connected to a server"); + $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ALREADY_CONNECTED' )); return false; } @@ -178,7 +178,7 @@ class SMTP { $tval); // give up after ? secs // verify we connected properly if(empty($this->smtp_conn)) { - $this->error = array("error" => "Failed to connect to server", + $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_FAILED_CONNECT_SERVER' ), "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { @@ -220,7 +220,7 @@ class SMTP { $this->error = null; # to avoid confusion if(!$this->connected()) { - $this->error = array("error" => "Called StartTLS() without being connected"); + $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_START_TLS' )); return false; } @@ -235,7 +235,7 @@ class SMTP { if($code != 220) { $this->error = - array("error" => "STARTTLS not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_START_TLS_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -278,7 +278,7 @@ class SMTP { if($code != 334) { $this->error = - array("error" => "AUTH not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -294,7 +294,7 @@ class SMTP { if($code != 235) { $this->error = - array("error" => "Authentication not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -312,7 +312,7 @@ class SMTP { if($code != 334) { $this->error = - array("error" => "AUTH not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -329,7 +329,7 @@ class SMTP { if($code != 334) { $this->error = - array("error" => "Username not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_USERNAME_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -346,7 +346,7 @@ class SMTP { if($code != 235) { $this->error = - array("error" => "Password not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_PASSWORD_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -369,7 +369,7 @@ class SMTP { if(! $ntlm_client->Initialize($temp)){//let's test if every function its available $this->error = array("error" => $temp->error); if($this->do_debug >= 1) { - $this->edebug("You need to enable some modules in your php.ini file: " . $this->error["error"] . $this->CRLF); + $this->edebug(G::LoadTranslation( 'ID_SMTP_ERROR_ENABLE_PHPINI' ) . ": " . $this->error["error"] . $this->CRLF); } return false; } @@ -383,7 +383,7 @@ class SMTP { if($code != 334) { $this->error = - array("error" => "AUTH not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_AUTH_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -404,7 +404,7 @@ class SMTP { if($code != 235) { $this->error = - array("error" => "Could not authenticate", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_COULD_NOT_AUTH' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -428,7 +428,7 @@ class SMTP { if($sock_status["eof"]) { // the socket is valid but we are not connected if($this->do_debug >= 1) { - $this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected"); + $this->edebug("SMTP -> NOTICE:" . $this->CRLF . G::LoadTranslation( 'ID_SMTP_ERROR_EOF_CAUGHT' )); } $this->Close(); return false; @@ -484,7 +484,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Data() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_DATA_WITHOUT' )); return false; } @@ -499,7 +499,7 @@ class SMTP { if($code != 354) { $this->error = - array("error" => "DATA command not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_DATA_COM_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -593,7 +593,7 @@ class SMTP { if($code != 250) { $this->error = - array("error" => "DATA not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_DATA_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -622,7 +622,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Hello() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_HELLO_WITHOUT' )); return false; } @@ -661,7 +661,7 @@ class SMTP { if($code != 250) { $this->error = - array("error" => $hello . " not accepted from server", + array("error" => $hello . ' ' . G::LoadTranslation( 'ID_SMTP_ERROR_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -695,7 +695,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Mail() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_MAIL_WITHOUT' )); return false; } @@ -711,7 +711,7 @@ class SMTP { if($code != 250) { $this->error = - array("error" => "MAIL not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_MAIL_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -739,7 +739,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Quit() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_QUIT_WITHOUT' )); return false; } @@ -759,7 +759,7 @@ class SMTP { $code = substr($byemsg,0,3); if($code != 221) { // use e as a tmp var cause Close will overwrite $this->error - $e = array("error" => "SMTP server rejected quit command", + $e = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_SERVER_REJECTED' ), "smtp_code" => $code, "smtp_rply" => substr($byemsg,4)); $rval = false; @@ -793,7 +793,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Recipient() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_RECIPIENT_WITHOUT' )); return false; } @@ -808,7 +808,7 @@ class SMTP { if($code != 250 && $code != 251) { $this->error = - array("error" => "RCPT not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_RCPT_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -836,7 +836,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called Reset() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_RESET_WITHOUT' )); return false; } @@ -851,7 +851,7 @@ class SMTP { if($code != 250) { $this->error = - array("error" => "RSET failed", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_RSET_FAILED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -885,7 +885,7 @@ class SMTP { if(!$this->connected()) { $this->error = array( - "error" => "Called SendAndMail() without being connected"); + "error" => G::LoadTranslation( 'ID_SMTP_ERROR_CALLED_SENDANDMAIL_WITHOUT' )); return false; } @@ -900,7 +900,7 @@ class SMTP { if($code != 250) { $this->error = - array("error" => "SAML not accepted from server", + array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_SAML_NOT_ACCEPTED' ), "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { @@ -925,8 +925,7 @@ class SMTP { * @return bool */ public function Turn() { - $this->error = array("error" => "This method, TURN, of the SMTP ". - "is not implemented"); + $this->error = array("error" => G::LoadTranslation( 'ID_SMTP_ERROR_MET_TURN_SMTP_NOT_IMPLEMENTED' )); if($this->do_debug >= 1) { $this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '
'); } diff --git a/rbac/engine/classes/model/Roles.php b/rbac/engine/classes/model/Roles.php index 000b5f8e9..81d8b251d 100755 --- a/rbac/engine/classes/model/Roles.php +++ b/rbac/engine/classes/model/Roles.php @@ -607,7 +607,9 @@ class Roles extends BaseRoles { $o = new RolesPermissions(); $o->setPerUid($sData['PER_UID']); $o->setRolUid($sData['ROL_UID']); - $o->setPermissionName($sData['PER_NAME']); + if (isset($sData['PER_NAME'])) { + $o->setPermissionName($sData['PER_NAME']); + } $o->save(); } diff --git a/workflow/engine/classes/class.configuration.php b/workflow/engine/classes/class.configuration.php index 5d4853cc6..b4718db22 100755 --- a/workflow/engine/classes/class.configuration.php +++ b/workflow/engine/classes/class.configuration.php @@ -596,9 +596,14 @@ class Configurations // extends Configuration break; } } - - setlocale(LC_TIME, $langLocate . ".utf8"); - $dateTime = strftime($newCreation, mktime($h, $i, $s, $m, $d, $y)); + + 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); diff --git a/workflow/engine/classes/class.pmScript.php b/workflow/engine/classes/class.pmScript.php index 8ba0fd43e..8feced918 100644 --- a/workflow/engine/classes/class.pmScript.php +++ b/workflow/engine/classes/class.pmScript.php @@ -151,6 +151,39 @@ class PMScript */ public function setScript ($sScript = '') { + if (!defined("T_ML_COMMENT")) { + define("T_ML_COMMENT", T_COMMENT); + } else { + define("T_DOC_COMMENT", T_ML_COMMENT); + } + + $script = "sScript = $sScript; } @@ -582,7 +615,7 @@ function handleFatalErrors ($buffer) if (strpos( $_SERVER['REQUEST_URI'], '&ACTION=GENERATE' ) !== false) { $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); if ($_SESSION['TRIGGER_DEBUG']['ISSET']) { - $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; + $_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER')); $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE']; $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug'; } @@ -605,7 +638,7 @@ function handleFatalErrors ($buffer) } else { $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); if (isset($_SESSION['TRIGGER_DEBUG']['ISSET']) && $_SESSION['TRIGGER_DEBUG']['ISSET']) { - $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; + $_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER')); $_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE']; $aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug'; } diff --git a/workflow/engine/classes/class.processMap.php b/workflow/engine/classes/class.processMap.php index 2d2a65c03..2faa8eb87 100755 --- a/workflow/engine/classes/class.processMap.php +++ b/workflow/engine/classes/class.processMap.php @@ -157,6 +157,7 @@ class processMap $oTask->position->x = (int) $aRow1['TAS_POSX']; $oTask->position->y = (int) $aRow1['TAS_POSY']; $oTask->derivation = new StdClass(); + $oTask->derivation->type = ''; $oTask->derivation->to = array(); $oCriteria = new Criteria('workflow'); $oCriteria->add(RoutePeer::PRO_UID, $sProcessUID); @@ -1909,7 +1910,7 @@ class processMap $aConditions[] = array('C2.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter ); $oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN); $oCriteria->add(DynaformPeer::PRO_UID, $sProcessUID); - + $oCriteria->addAscendingOrderByColumn('DYN_TITLE'); $oDataset = DynaformPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 478172cd9..d7ee43a30 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1096,7 +1096,7 @@ class workspaceTools $command = 'mysql' . ' --host=' . $parameters['dbHost'] . ' --user=' . $parameters['dbUser'] - . ' --password=' . $parameters['dbPass'] + . ' --password=' . str_replace('"', '\"', str_replace("'", "\'", quotemeta($parameters['dbPass'])))//no change! supports the type passwords: .\+*?[^]($)'"\"' . ' --database=' . mysql_real_escape_string($database) . ' --default_character_set utf8' . ' --execute="SOURCE '.$filename.'"'; diff --git a/workflow/engine/classes/model/AdditionalTables.php b/workflow/engine/classes/model/AdditionalTables.php index 7448f60d3..5139f0913 100755 --- a/workflow/engine/classes/model/AdditionalTables.php +++ b/workflow/engine/classes/model/AdditionalTables.php @@ -392,9 +392,21 @@ class AdditionalTables extends BaseAdditionalTables $oCriteria = new Criteria($aData['DBS_UID']); //eval('$oCriteria->addSelectColumn("\'1\' AS DUMMY");'); + + /* + * data type: + * 'INTEGER' 'BIGINT' 'SMALLINT' 'TINYINT' 'DECIMAL' 'DOUBLE' 'FLOAT' 'REAL' + * 'CHAR' 'VARCHAR' 'LONGVARCHAR' 'BOOLEAN' 'DATE' 'DATETIME' 'TIME' + */ + $types = array('DECIMAL', 'DOUBLE', 'FLOAT', 'REAL'); + if ($keyOrderUppercase == true) { foreach ($aData['FIELDS'] as $aField) { - eval('$oCriteria->addSelectColumn(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ');'); + $field = '$oCriteria->addSelectColumn(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ');'; + if (in_array($aField['FLD_TYPE'], $types)) { + $field = '$oCriteria->addAsColumn("' . $aField['FLD_NAME'] . '", "round(" . ' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ' . ", 2)" );'; + } + eval($field); /*if ($aField['FLD_KEY'] == '1') { eval('$oCriteria->addAscendingOrderByColumn('. $sClassPeerName . '::' . $aField['FLD_NAME'] . ');'); }*/ @@ -405,37 +417,27 @@ class AdditionalTables extends BaseAdditionalTables eval('$count = ' . $sClassPeerName . '::doCount($oCriteria);'); if ($filter != '' && is_string($filter)) { - eval('$fieldsTable = ' . $sClassPeerName . '::getFieldNames(BasePeer::TYPE_FIELDNAME);'); - $countField = count($fieldsTable); $stringOr = '$oCriteria->add('; - $cont = 0; - $fieldAppUid = ''; - foreach ($fieldsTable as $value) { - if ($value != 'APP_UID') { - if (($cont+1) == $countField) { - if ($aData['FIELDS'][$cont]['FLD_TYPE'] == 'VARCHAR') { - $stringOr .= '$oCriteria->getNewCriterion(' . $sClassPeerName . '::' . strtoupper($value) . ', "%' . $filter . '%", Criteria::LIKE)'; + $closure = ''; + $compare = ''; + $types = array('INTEGER', 'BIGINT', 'SMALLINT', 'TINYINT', 'DECIMAL', 'DOUBLE', 'FLOAT', 'REAL'); + foreach ($aData['FIELDS'] as $aField) { + if ($aField['FLD_NAME'] != 'APP_UID') { + $compare = '"%' . $filter . '%", Criteria::LIKE'; + + if (in_array($aField['FLD_TYPE'], $types)) { + if (is_numeric($filter)) { + $compare = '"' . $filter . '", Criteria::EQUAL'; } else { - $stringOr .= '$oCriteria->getNewCriterion(' . $sClassPeerName . '::' . strtoupper($value) . ', "' . $filter . '", Criteria::LIKE)'; - } - } else { - if ($aData['FIELDS'][$cont]['FLD_TYPE'] == 'VARCHAR') { - $stringOr .= '$oCriteria->getNewCriterion(' . $sClassPeerName . '::' . strtoupper($value) . ', "%' . $filter . '%", Criteria::LIKE)->addOr('; - } else { - $stringOr .= '$oCriteria->getNewCriterion(' . $sClassPeerName . '::' . strtoupper($value) . ', "' . $filter . '", Criteria::LIKE)->addOr('; + $compare = 'null, Criteria::ISNULL'; } } - } else { - $fieldAppUid = $cont; - } - $cont++; - } - for ($c = 0; $c < $countField-1; $c++) { - if ($fieldAppUid !== $c) { - $stringOr .= ')'; + + $stringOr = $stringOr . '$oCriteria->getNewCriterion(' . $sClassPeerName . '::' . $aField['FLD_NAME'] . ', ' . $compare . ')->addOr('; + $closure = $closure . ")"; } } - $stringOr .= ');'; + $stringOr = rtrim($stringOr, '->addOr(') . $closure . ';'; eval($stringOr); $oCriteriaCount = clone $oCriteria; diff --git a/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php b/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php index d4f7be1cd..75e5cfb5e 100755 --- a/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php +++ b/workflow/engine/classes/model/map/OutputDocumentMapBuilder.php @@ -8,7 +8,6 @@ include_once 'creole/CreoleTypes.php'; * This class adds structure of 'OUTPUT_DOCUMENT' table to 'workflow' DatabaseMap object. * * - * * These statically-built map classes are used by Propel to do runtime db structure discovery. * For example, the createSelectSql() method checks the type of a given column used in an * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive @@ -105,6 +104,8 @@ class OutputDocumentMapBuilder $tMap->addColumn('OUT_DOC_PDF_SECURITY_PERMISSIONS', 'OutDocPdfSecurityPermissions', 'string', CreoleTypes::VARCHAR, false, 150); + $tMap->addColumn('OUT_DOC_OPEN_TYPE', 'OutDocOpenType', 'int', CreoleTypes::INTEGER, false, null); + $tMap->addValidator('OUT_DOC_UID', 'maxLength', 'propel.validator.MaxLengthValidator', '32', 'Output Document UID can be no larger than 32 in size'); $tMap->addValidator('OUT_DOC_UID', 'required', 'propel.validator.RequiredValidator', '', 'Output Document UID is required.'); diff --git a/workflow/engine/classes/model/om/BaseOutputDocument.php b/workflow/engine/classes/model/om/BaseOutputDocument.php index b71ff437f..73dfa9c0b 100755 --- a/workflow/engine/classes/model/om/BaseOutputDocument.php +++ b/workflow/engine/classes/model/om/BaseOutputDocument.php @@ -4,16 +4,15 @@ require_once 'propel/om/BaseObject.php'; require_once 'propel/om/Persistent.php'; - include_once 'propel/util/Criteria.php'; include_once 'classes/model/OutputDocumentPeer.php'; /** * Base class that represents a row from the 'OUTPUT_DOCUMENT' table. - * * * + * * @package workflow.classes.model.om */ abstract class BaseOutputDocument extends BaseObject implements Persistent @@ -147,6 +146,12 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent */ protected $out_doc_pdf_security_permissions = ''; + /** + * The value for the out_doc_open_type field. + * @var int + */ + protected $out_doc_open_type = 0; + /** * Flag to prevent endless save loop, if this object is referenced * by another object which falls in this transaction. @@ -381,6 +386,17 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent return $this->out_doc_pdf_security_permissions; } + /** + * Get the [out_doc_open_type] column value. + * + * @return int + */ + public function getOutDocOpenType() + { + + return $this->out_doc_open_type; + } + /** * Set the value of [out_doc_uid] column. * @@ -821,6 +837,28 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent } // setOutDocPdfSecurityPermissions() + /** + * Set the value of [out_doc_open_type] column. + * + * @param int $v new value + * @return void + */ + public function setOutDocOpenType($v) + { + + // Since the native PHP type for this column is integer, + // we will cast the input value to an int (if it is not). + if ($v !== null && !is_int($v) && is_numeric($v)) { + $v = (int) $v; + } + + if ($this->out_doc_open_type !== $v || $v === 0) { + $this->out_doc_open_type = $v; + $this->modifiedColumns[] = OutputDocumentPeer::OUT_DOC_OPEN_TYPE; + } + + } // setOutDocOpenType() + /** * Hydrates (populates) the object variables with values from the database resultset. * @@ -878,12 +916,14 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent $this->out_doc_pdf_security_permissions = $rs->getString($startcol + 19); + $this->out_doc_open_type = $rs->getInt($startcol + 20); + $this->resetModified(); $this->setNew(false); // FIXME - using NUM_COLUMNS may be clearer. - return $startcol + 20; // 20 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS). + return $startcol + 21; // 21 = OutputDocumentPeer::NUM_COLUMNS - OutputDocumentPeer::NUM_LAZY_LOAD_COLUMNS). } catch (Exception $e) { throw new PropelException("Error populating OutputDocument object", $e); @@ -1147,6 +1187,9 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent case 19: return $this->getOutDocPdfSecurityPermissions(); break; + case 20: + return $this->getOutDocOpenType(); + break; default: return null; break; @@ -1187,6 +1230,7 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent $keys[17] => $this->getOutDocPdfSecurityOpenPassword(), $keys[18] => $this->getOutDocPdfSecurityOwnerPassword(), $keys[19] => $this->getOutDocPdfSecurityPermissions(), + $keys[20] => $this->getOutDocOpenType(), ); return $result; } @@ -1278,6 +1322,9 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent case 19: $this->setOutDocPdfSecurityPermissions($value); break; + case 20: + $this->setOutDocOpenType($value); + break; } // switch() } @@ -1381,6 +1428,10 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent $this->setOutDocPdfSecurityPermissions($arr[$keys[19]]); } + if (array_key_exists($keys[20], $arr)) { + $this->setOutDocOpenType($arr[$keys[20]]); + } + } /** @@ -1472,6 +1523,10 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent $criteria->add(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, $this->out_doc_pdf_security_permissions); } + if ($this->isColumnModified(OutputDocumentPeer::OUT_DOC_OPEN_TYPE)) { + $criteria->add(OutputDocumentPeer::OUT_DOC_OPEN_TYPE, $this->out_doc_open_type); + } + return $criteria; } @@ -1564,6 +1619,8 @@ abstract class BaseOutputDocument extends BaseObject implements Persistent $copyObj->setOutDocPdfSecurityPermissions($this->out_doc_pdf_security_permissions); + $copyObj->setOutDocOpenType($this->out_doc_open_type); + $copyObj->setNew(true); diff --git a/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php b/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php index 0ab08dcd0..aafaaa4ef 100755 --- a/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php +++ b/workflow/engine/classes/model/om/BaseOutputDocumentPeer.php @@ -7,9 +7,9 @@ include_once 'classes/model/OutputDocument.php'; /** * Base static class for performing query and update operations on the 'OUTPUT_DOCUMENT' table. - * * * + * * @package workflow.classes.model.om */ abstract class BaseOutputDocumentPeer @@ -25,7 +25,7 @@ abstract class BaseOutputDocumentPeer const CLASS_DEFAULT = 'classes.model.OutputDocument'; /** The total number of columns. */ - const NUM_COLUMNS = 20; + const NUM_COLUMNS = 21; /** The number of lazy-loaded columns. */ const NUM_LAZY_LOAD_COLUMNS = 0; @@ -91,6 +91,9 @@ abstract class BaseOutputDocumentPeer /** the column name for the OUT_DOC_PDF_SECURITY_PERMISSIONS field */ const OUT_DOC_PDF_SECURITY_PERMISSIONS = 'OUTPUT_DOCUMENT.OUT_DOC_PDF_SECURITY_PERMISSIONS'; + /** the column name for the OUT_DOC_OPEN_TYPE field */ + const OUT_DOC_OPEN_TYPE = 'OUTPUT_DOCUMENT.OUT_DOC_OPEN_TYPE'; + /** The PHP to DB Name Mapping */ private static $phpNameMap = null; @@ -102,10 +105,10 @@ abstract class BaseOutputDocumentPeer * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ private static $fieldNames = array ( - BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocReportGenerator', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', 'OutDocPdfSecurityEnabled', 'OutDocPdfSecurityOpenPassword', 'OutDocPdfSecurityOwnerPassword', 'OutDocPdfSecurityPermissions', ), - BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_REPORT_GENERATOR, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, ), - BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_REPORT_GENERATOR', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', 'OUT_DOC_PDF_SECURITY_ENABLED', 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OUT_DOC_PDF_SECURITY_PERMISSIONS', ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ) + BasePeer::TYPE_PHPNAME => array ('OutDocUid', 'ProUid', 'OutDocReportGenerator', 'OutDocLandscape', 'OutDocMedia', 'OutDocLeftMargin', 'OutDocRightMargin', 'OutDocTopMargin', 'OutDocBottomMargin', 'OutDocGenerate', 'OutDocType', 'OutDocCurrentRevision', 'OutDocFieldMapping', 'OutDocVersioning', 'OutDocDestinationPath', 'OutDocTags', 'OutDocPdfSecurityEnabled', 'OutDocPdfSecurityOpenPassword', 'OutDocPdfSecurityOwnerPassword', 'OutDocPdfSecurityPermissions', 'OutDocOpenType', ), + BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID, OutputDocumentPeer::PRO_UID, OutputDocumentPeer::OUT_DOC_REPORT_GENERATOR, OutputDocumentPeer::OUT_DOC_LANDSCAPE, OutputDocumentPeer::OUT_DOC_MEDIA, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN, OutputDocumentPeer::OUT_DOC_TOP_MARGIN, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN, OutputDocumentPeer::OUT_DOC_GENERATE, OutputDocumentPeer::OUT_DOC_TYPE, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING, OutputDocumentPeer::OUT_DOC_VERSIONING, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH, OutputDocumentPeer::OUT_DOC_TAGS, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS, OutputDocumentPeer::OUT_DOC_OPEN_TYPE, ), + BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID', 'PRO_UID', 'OUT_DOC_REPORT_GENERATOR', 'OUT_DOC_LANDSCAPE', 'OUT_DOC_MEDIA', 'OUT_DOC_LEFT_MARGIN', 'OUT_DOC_RIGHT_MARGIN', 'OUT_DOC_TOP_MARGIN', 'OUT_DOC_BOTTOM_MARGIN', 'OUT_DOC_GENERATE', 'OUT_DOC_TYPE', 'OUT_DOC_CURRENT_REVISION', 'OUT_DOC_FIELD_MAPPING', 'OUT_DOC_VERSIONING', 'OUT_DOC_DESTINATION_PATH', 'OUT_DOC_TAGS', 'OUT_DOC_PDF_SECURITY_ENABLED', 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD', 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD', 'OUT_DOC_PDF_SECURITY_PERMISSIONS', 'OUT_DOC_OPEN_TYPE', ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); /** @@ -115,10 +118,10 @@ abstract class BaseOutputDocumentPeer * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 */ private static $fieldKeys = array ( - BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocReportGenerator' => 2, 'OutDocLandscape' => 3, 'OutDocMedia' => 4, 'OutDocLeftMargin' => 5, 'OutDocRightMargin' => 6, 'OutDocTopMargin' => 7, 'OutDocBottomMargin' => 8, 'OutDocGenerate' => 9, 'OutDocType' => 10, 'OutDocCurrentRevision' => 11, 'OutDocFieldMapping' => 12, 'OutDocVersioning' => 13, 'OutDocDestinationPath' => 14, 'OutDocTags' => 15, 'OutDocPdfSecurityEnabled' => 16, 'OutDocPdfSecurityOpenPassword' => 17, 'OutDocPdfSecurityOwnerPassword' => 18, 'OutDocPdfSecurityPermissions' => 19, ), - BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_REPORT_GENERATOR => 2, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 3, OutputDocumentPeer::OUT_DOC_MEDIA => 4, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 6, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 7, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 8, OutputDocumentPeer::OUT_DOC_GENERATE => 9, OutputDocumentPeer::OUT_DOC_TYPE => 10, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 11, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 12, OutputDocumentPeer::OUT_DOC_VERSIONING => 13, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 14, OutputDocumentPeer::OUT_DOC_TAGS => 15, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED => 16, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD => 17, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD => 18, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS => 19, ), - BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_REPORT_GENERATOR' => 2, 'OUT_DOC_LANDSCAPE' => 3, 'OUT_DOC_MEDIA' => 4, 'OUT_DOC_LEFT_MARGIN' => 5, 'OUT_DOC_RIGHT_MARGIN' => 6, 'OUT_DOC_TOP_MARGIN' => 7, 'OUT_DOC_BOTTOM_MARGIN' => 8, 'OUT_DOC_GENERATE' => 9, 'OUT_DOC_TYPE' => 10, 'OUT_DOC_CURRENT_REVISION' => 11, 'OUT_DOC_FIELD_MAPPING' => 12, 'OUT_DOC_VERSIONING' => 13, 'OUT_DOC_DESTINATION_PATH' => 14, 'OUT_DOC_TAGS' => 15, 'OUT_DOC_PDF_SECURITY_ENABLED' => 16, 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => 17, 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => 18, 'OUT_DOC_PDF_SECURITY_PERMISSIONS' => 19, ), - BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ) + BasePeer::TYPE_PHPNAME => array ('OutDocUid' => 0, 'ProUid' => 1, 'OutDocReportGenerator' => 2, 'OutDocLandscape' => 3, 'OutDocMedia' => 4, 'OutDocLeftMargin' => 5, 'OutDocRightMargin' => 6, 'OutDocTopMargin' => 7, 'OutDocBottomMargin' => 8, 'OutDocGenerate' => 9, 'OutDocType' => 10, 'OutDocCurrentRevision' => 11, 'OutDocFieldMapping' => 12, 'OutDocVersioning' => 13, 'OutDocDestinationPath' => 14, 'OutDocTags' => 15, 'OutDocPdfSecurityEnabled' => 16, 'OutDocPdfSecurityOpenPassword' => 17, 'OutDocPdfSecurityOwnerPassword' => 18, 'OutDocPdfSecurityPermissions' => 19, 'OutDocOpenType' => 20, ), + BasePeer::TYPE_COLNAME => array (OutputDocumentPeer::OUT_DOC_UID => 0, OutputDocumentPeer::PRO_UID => 1, OutputDocumentPeer::OUT_DOC_REPORT_GENERATOR => 2, OutputDocumentPeer::OUT_DOC_LANDSCAPE => 3, OutputDocumentPeer::OUT_DOC_MEDIA => 4, OutputDocumentPeer::OUT_DOC_LEFT_MARGIN => 5, OutputDocumentPeer::OUT_DOC_RIGHT_MARGIN => 6, OutputDocumentPeer::OUT_DOC_TOP_MARGIN => 7, OutputDocumentPeer::OUT_DOC_BOTTOM_MARGIN => 8, OutputDocumentPeer::OUT_DOC_GENERATE => 9, OutputDocumentPeer::OUT_DOC_TYPE => 10, OutputDocumentPeer::OUT_DOC_CURRENT_REVISION => 11, OutputDocumentPeer::OUT_DOC_FIELD_MAPPING => 12, OutputDocumentPeer::OUT_DOC_VERSIONING => 13, OutputDocumentPeer::OUT_DOC_DESTINATION_PATH => 14, OutputDocumentPeer::OUT_DOC_TAGS => 15, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_ENABLED => 16, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OPEN_PASSWORD => 17, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_OWNER_PASSWORD => 18, OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS => 19, OutputDocumentPeer::OUT_DOC_OPEN_TYPE => 20, ), + BasePeer::TYPE_FIELDNAME => array ('OUT_DOC_UID' => 0, 'PRO_UID' => 1, 'OUT_DOC_REPORT_GENERATOR' => 2, 'OUT_DOC_LANDSCAPE' => 3, 'OUT_DOC_MEDIA' => 4, 'OUT_DOC_LEFT_MARGIN' => 5, 'OUT_DOC_RIGHT_MARGIN' => 6, 'OUT_DOC_TOP_MARGIN' => 7, 'OUT_DOC_BOTTOM_MARGIN' => 8, 'OUT_DOC_GENERATE' => 9, 'OUT_DOC_TYPE' => 10, 'OUT_DOC_CURRENT_REVISION' => 11, 'OUT_DOC_FIELD_MAPPING' => 12, 'OUT_DOC_VERSIONING' => 13, 'OUT_DOC_DESTINATION_PATH' => 14, 'OUT_DOC_TAGS' => 15, 'OUT_DOC_PDF_SECURITY_ENABLED' => 16, 'OUT_DOC_PDF_SECURITY_OPEN_PASSWORD' => 17, 'OUT_DOC_PDF_SECURITY_OWNER_PASSWORD' => 18, 'OUT_DOC_PDF_SECURITY_PERMISSIONS' => 19, 'OUT_DOC_OPEN_TYPE' => 20, ), + BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ) ); /** @@ -259,6 +262,8 @@ abstract class BaseOutputDocumentPeer $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_PDF_SECURITY_PERMISSIONS); + $criteria->addSelectColumn(OutputDocumentPeer::OUT_DOC_OPEN_TYPE); + } const COUNT = 'COUNT(OUTPUT_DOCUMENT.OUT_DOC_UID)'; diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index 2837ae1bf..6ea94b52a 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -781,6 +781,7 @@ + diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index ec4a48feb..df6a83f65 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -135,6 +135,7 @@ class adminProxy extends HttpProxyController $list = $data; } + $oRoles = new Roles(); $rows = array(); foreach ($list as $value) { @@ -144,6 +145,13 @@ class adminProxy extends HttpProxyController $user->save(); $row = $user->toArray(BasePeer::TYPE_FIELDNAME); + try { + $uRole = $oRoles->loadByCode($row['USR_ROLE']); + } catch (exception $oError) { + $uRole['ROL_NAME'] = G::loadTranslation( 'ID_DELETED' ); + } + $row['USR_ROLE_ID'] = $row['USR_ROLE']; + $row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE']; $uxList = self::getUxTypesList(); $row['USR_UX'] = $uxList[$user->getUsrUx()]; diff --git a/workflow/engine/controllers/dashboard.php b/workflow/engine/controllers/dashboard.php index e98ad5a9b..66b4868df 100644 --- a/workflow/engine/controllers/dashboard.php +++ b/workflow/engine/controllers/dashboard.php @@ -332,7 +332,9 @@ class Dashboard extends Controller $users[] = array ('OWNER_UID' => $user['USR_UID'],'OWNER_NAME' => $user['USR_FIRSTNAME'] . ' ' . $user['USR_LASTNAME'] ); } - + usort($users, function($str1, $str2) { + return strcmp(strtolower($str1["OWNER_NAME"]), strtolower($str2["OWNER_NAME"])); + }); $result->total = $allUsers->totalCount; $result->owners = $users; break; diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 06b8dadd8..6ea704e96 100755 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -43,13 +43,13 @@ class Home extends Controller } public function login ($httpData) - { + { //start new session @session_destroy(); session_start(); session_regenerate_id(); - $data = isset( $httpData->d ) ? unserialize( base64_decode( $httpData->d ) ) : ''; + $data = isset( $httpData->d ) ? unserialize( base64_decode( $httpData->d ) ) : ''; $template = $this->clientBrowser['name'] == 'msie' ? 'login_ie' : 'login_standard'; $skin = $this->clientBrowser['name'] == 'msie' ? $this->lastSkin : 'simplified'; @@ -94,8 +94,20 @@ class Home extends Controller $start = 0; $limit = ''; - $proData = $process->getAllProcesses( $start, $limit ); - $processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' ); + $proData = $process->getAllProcesses( $start, $limit, null, null, false, true ); + $processList = $case->getStartCasesPerType( $_SESSION['USER_LOGGED'], 'category' ); + + unset( $processList[0] ); + $processesList = array (); + + foreach ($processList as $key => $valueProcess) { + foreach ($proData as $keyPro => $valuePro) { + if ($valueProcess['pro_uid'] == $valuePro['PRO_UID']) { + $processesList[] = $valueProcess; + } + } + } + $switchLink = $userProperty->getUserLocation( $_SESSION['USER_LOGGED'] ); if (!isset($_COOKIE['workspaceSkin'])) { @@ -105,7 +117,13 @@ class Home extends Controller } } - unset( $processList[0] ); + $oServerConf = & serverConf::getSingleton(); + + if ($oServerConf->isRtl( SYS_LANG )) { + $swRtl = 1; + } else { + $swRtl = 0; + } //Get simplified options global $G_TMP_MENU; @@ -132,13 +150,14 @@ class Home extends Controller $this->setVar( 'usrUid', $this->userID ); $this->setVar( 'userName', $this->userName ); - $this->setVar( 'processList', $processList ); + $this->setVar( 'processList', $processesList ); $this->setVar( 'canStartCase', $case->canStartCase( $_SESSION['USER_LOGGED'] ) ); $this->setVar( 'userUxType', $this->userUxType ); $this->setVar( 'clientBrowser', $this->clientBrowser['name'] ); $this->setVar( 'switchLink', $switchLink ); $this->setVar( 'arrayMnuOption', $arrayMnuOption ); $this->setVar( 'mnuNewCase', $mnuNewCase ); + $this->setVar( 'rtl', $swRtl ); $this->render(); } @@ -183,7 +202,7 @@ class Home extends Controller } public function appList ($httpData) - { + { // setting default list applications types [default: todo] $httpData->t = isset( $httpData->t ) ? $httpData->t : 'todo'; @@ -270,7 +289,7 @@ class Home extends Controller } public function getApps ($httpData) - { + { $cases = $this->getAppsData( $httpData->t, $httpData->start, $httpData->limit ); $this->setView( $this->userUxBaseTemplate . PATH_SEP . 'applications' ); @@ -293,7 +312,7 @@ class Home extends Controller $dir = null, $sort = "APP_CACHE_VIEW.APP_NUMBER", $category = null) - { + { require_once ("classes/model/AppNotes.php"); G::LoadClass( 'applications' ); @@ -545,7 +564,7 @@ class Home extends Controller return $status; } function getProcessArray($action, $userUid) - { + { global $oAppCache; $processes = array(); @@ -576,6 +595,7 @@ class Home extends Controller $cProcess->addJoinMC($conds, Criteria::LEFT_JOIN); $cProcess->add(ProcessPeer::PRO_STATUS, "ACTIVE"); $oDataset = ProcessPeer::doSelectRS($cProcess); + $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index aaefae711..55d6469c2 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -199,6 +199,7 @@ class pmTablesProxy extends HttpProxyController $result = new StdClass(); try { + $result = new stdClass(); ob_start(); $data = (array) $httpData; $data['PRO_UID'] = trim( $data['PRO_UID'] ); @@ -327,6 +328,7 @@ class pmTablesProxy extends HttpProxyController $result->success = true; $result->message = $result->msg = $buildResult; } catch (Exception $e) { + $result = new stdClass(); $buildResult = ob_get_contents(); ob_end_clean(); $result->success = false; @@ -353,6 +355,7 @@ class pmTablesProxy extends HttpProxyController */ public function delete ($httpData) { + $result = new stdClass(); $rows = G::json_decode( stripslashes( $httpData->rows ) ); $errors = ''; $count = 0; @@ -737,6 +740,7 @@ class pmTablesProxy extends HttpProxyController { require_once 'classes/model/AdditionalTables.php'; try { + $result = new stdClass(); $errors = ''; $overWrite = isset( $_POST['form']['OVERWRITE'] ) ? true : false; @@ -964,6 +968,7 @@ class pmTablesProxy extends HttpProxyController $result->message = $msg; } catch (Exception $e) { + $result = new stdClass(); $result->errorType = 'error'; $result->buildResult = ob_get_contents(); ob_end_clean(); @@ -995,6 +1000,7 @@ class pmTablesProxy extends HttpProxyController $tablesToExport = G::json_decode( stripslashes( $httpData->rows ) ); try { + $result = new stdClass(); G::LoadCLass( 'net' ); $net = new NET( G::getIpAddress() ); @@ -1095,6 +1101,7 @@ class pmTablesProxy extends HttpProxyController $result->link = $link; $result->message = "Generated file: $filenameOnly, size: $size"; } catch (Exception $e) { + $result = new stdClass(); $result->success = false; $result->message = $e->getMessage(); } @@ -1227,6 +1234,7 @@ class pmTablesProxy extends HttpProxyController public function genDataReport ($httpData) { + $result = new stdClass(); G::loadClass( 'pmTable' ); require_once 'classes/model/AdditionalTables.php'; $result->message = ''; diff --git a/workflow/engine/data/mssql/schema.sql b/workflow/engine/data/mssql/schema.sql index 4fcda9090..04264711d 100755 --- a/workflow/engine/data/mssql/schema.sql +++ b/workflow/engine/data/mssql/schema.sql @@ -852,6 +852,7 @@ CREATE TABLE [OUTPUT_DOCUMENT] [OUT_DOC_PDF_SECURITY_OPEN_PASSWORD] VARCHAR(32) default '' NULL, [OUT_DOC_PDF_SECURITY_OWNER_PASSWORD] VARCHAR(32) default '' NULL, [OUT_DOC_PDF_SECURITY_PERMISSIONS] VARCHAR(150) default '' NULL, + [OUT_DOC_OPEN_TYPE] INT default 0 NULL, CONSTRAINT OUTPUT_DOCUMENT_PK PRIMARY KEY ([OUT_DOC_UID]) ); diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index d4c362b41..7c5c6bf4a 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -374,6 +374,7 @@ CREATE TABLE `OUTPUT_DOCUMENT` `OUT_DOC_PDF_SECURITY_OPEN_PASSWORD` VARCHAR(32) default '', `OUT_DOC_PDF_SECURITY_OWNER_PASSWORD` VARCHAR(32) default '', `OUT_DOC_PDF_SECURITY_PERMISSIONS` VARCHAR(150) default '', + `OUT_DOC_OPEN_TYPE` INTEGER default 0, PRIMARY KEY (`OUT_DOC_UID`) )ENGINE=InnoDB DEFAULT CHARSET='utf8'; #----------------------------------------------------------------------------- diff --git a/workflow/engine/data/oracle/schema.sql b/workflow/engine/data/oracle/schema.sql index 21c1e0227..6a5cba79e 100755 --- a/workflow/engine/data/oracle/schema.sql +++ b/workflow/engine/data/oracle/schema.sql @@ -470,7 +470,8 @@ CREATE TABLE "OUTPUT_DOCUMENT" "OUT_DOC_PDF_SECURITY_ENABLED" NUMBER(3,0) default 0, "OUT_DOC_PDF_SECURITY_OPEN_PASSWORD" VARCHAR2(32) default '', "OUT_DOC_PDF_SECURITY_OWNER_PASSWORD" VARCHAR2(32) default '', - "OUT_DOC_PDF_SECURITY_PERMISSIONS" VARCHAR2(150) default '' + "OUT_DOC_PDF_SECURITY_PERMISSIONS" VARCHAR2(150) default '', + "OUT_DOC_OPEN_TYPE" NUMBER default 0 ); ALTER TABLE "OUTPUT_DOCUMENT" diff --git a/workflow/engine/methods/cases/ajaxListener.php b/workflow/engine/methods/cases/ajaxListener.php index bc66b38e3..07d057483 100755 --- a/workflow/engine/methods/cases/ajaxListener.php +++ b/workflow/engine/methods/cases/ajaxListener.php @@ -334,8 +334,9 @@ class Ajax $processData['PRO_AUTHOR'] = '(USER DELETED)'; } - $processData['PRO_CREATE_DATE'] = date('F j, Y', strtotime($processData['PRO_CREATE_DATE'])); - + $conf = new Configurations(); + $conf->getFormats(); + $processData['PRO_CREATE_DATE'] = $conf->getSystemDate($processData['PRO_CREATE_DATE']); print (G::json_encode($processData)); } diff --git a/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php b/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php index a338ff5a8..762e2a1ba 100644 --- a/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php +++ b/workflow/engine/methods/cases/casesHistoryDynaformPage_Ajax.php @@ -461,6 +461,7 @@ if ($actionAjax == 'historyDynaformGridPreview') { AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' ); @@ -478,6 +479,6 @@ if ($actionAjax == 'historyDynaformGridPreview') { loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' ); $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers ); -$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; +$_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER')); if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) { $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); diff --git a/workflow/engine/methods/cases/casesStartPage_Ajax.php b/workflow/engine/methods/cases/casesStartPage_Ajax.php index bdc2cdfed..f5cdda0bc 100755 --- a/workflow/engine/methods/cases/casesStartPage_Ajax.php +++ b/workflow/engine/methods/cases/casesStartPage_Ajax.php @@ -70,7 +70,7 @@ function getProcessList () if (1) { foreach ($processList as $key => $processInfo) { $tempTree['text'] = $key; - $tempTree['id'] = preg_replace('([^A-Za-z0-9])', '', $key); + $tempTree['id'] = md5($key); $tempTree['cls'] = 'folder'; $tempTree['draggable'] = true; $tempTree['optionType'] = "category"; @@ -87,7 +87,7 @@ function getProcessList () //print_r($processInfo); $tempTreeChild['text'] = htmlentities($keyChild, ENT_QUOTES, 'UTF-8'); //ellipsis ( $keyChild, 50 ); //$tempTree['text']=$key; - $tempTreeChild['id'] = preg_replace('([^A-Za-z0-9 ()])', '', $keyChild); + $tempTreeChild['id'] = md5($keyChild); $tempTreeChild['draggable'] = true; $tempTreeChild['leaf'] = true; $tempTreeChild['icon'] = '/images/icon.trigger.png'; diff --git a/workflow/engine/methods/cases/cases_Derivate.php b/workflow/engine/methods/cases/cases_Derivate.php index be0e388d3..5855894c5 100755 --- a/workflow/engine/methods/cases/cases_Derivate.php +++ b/workflow/engine/methods/cases/cases_Derivate.php @@ -75,7 +75,7 @@ try { //save trigger variables for debugger $_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof( $triggers ); - $_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE'; + $_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = G::toUpper(G::loadTranslation('ID_BEFORE')); $_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); $_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers; } @@ -104,7 +104,7 @@ try { $_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof( $triggers ); - $_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER'; + $_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER')); $_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); $_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers; } diff --git a/workflow/engine/methods/cases/cases_SaveData.php b/workflow/engine/methods/cases/cases_SaveData.php index 73f968474..f391fd96d 100644 --- a/workflow/engine/methods/cases/cases_SaveData.php +++ b/workflow/engine/methods/cases/cases_SaveData.php @@ -69,7 +69,7 @@ try { $triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' ); $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers ); - $_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER'; + $_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_AFTER')); if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) { $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers; diff --git a/workflow/engine/methods/cases/cases_ShowOutputDocument.php b/workflow/engine/methods/cases/cases_ShowOutputDocument.php index 49eeee328..61e7e667c 100755 --- a/workflow/engine/methods/cases/cases_ShowOutputDocument.php +++ b/workflow/engine/methods/cases/cases_ShowOutputDocument.php @@ -33,19 +33,26 @@ if (!isset($_SESSION['USER_LOGGED'])) { * * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. - */ -/* - * Created on 13-02-2008 - * - * @author David Callizaya + * + * Created on 13-02-2008 + * + * + * @author David Callizaya */ require_once ("classes/model/AppDocumentPeer.php"); +require_once ("classes/model/OutputDocumentPeer.php"); $oAppDocument = new AppDocument(); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : null ); $sAppDocUid = $oAppDocument->getAppDocUid(); +$sDocUid = $oAppDocument->Fields['DOC_UID']; + +$oOutputDocument = new OutputDocument(); +$oOutputDocument->Fields = $oOutputDocument->getByUid( $sDocUid ); +$download = $oOutputDocument->Fields['OUT_DOC_OPEN_TYPE']; + $info = pathinfo( $oAppDocument->getAppDocFilename() ); if (! isset( $_GET['ext'] )) { $ext = $info['extension']; @@ -58,7 +65,7 @@ if (! isset( $_GET['ext'] )) { } $ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : ''; -if (! $ver) //This code is in the case the outputdocument won't be versioned +if (! $ver) //This code is in the case the outputdocument won't be versioned $ver = '_1'; $realPath = PATH_DOCUMENT . G::getPathFromUID($oAppDocument->Fields['APP_UID']) . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext; @@ -102,7 +109,7 @@ if (! $sw_file_exists) { $res['message'] = $info['basename'] . $ver . '.' . $ext; print G::json_encode( $res ); } else { - G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext ); + G::streamFile( $realPath, $download, $info['basename'] . $ver . '.' . $ext ); } } //G::streamFile ( $realPath, true); diff --git a/workflow/engine/methods/cases/cases_Step.php b/workflow/engine/methods/cases/cases_Step.php index 80eb5347a..4e155d215 100755 --- a/workflow/engine/methods/cases/cases_Step.php +++ b/workflow/engine/methods/cases/cases_Step.php @@ -138,7 +138,7 @@ if (! isset( $_GET['breakpoint'] )) { $triggers = $oCase->loadTriggers( $_SESSION['TASK'], $_GET['TYPE'], $_GET['UID'], 'BEFORE' ); $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers ); - $_SESSION['TRIGGER_DEBUG']['TIME'] = 'BEFORE'; + $_SESSION['TRIGGER_DEBUG']['TIME'] = G::toUpper(G::loadTranslation('ID_BEFORE')); if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) { $_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers ); $_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers; @@ -187,7 +187,7 @@ $oCase->updateCase( $_SESSION['APPLICATION'], $Fields ); //Obtain previous and next step - Start -try { +try { $oCase = new Cases(); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); $aPreviousStep = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); @@ -259,12 +259,12 @@ try { $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['UID'], '', $Fields['APP_DATA'], 'cases_SaveData?UID=' . $_GET['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'], '', (strtolower( $oStep->getStepMode() ) != 'edit' ? strtolower( $oStep->getStepMode() ) : '') ); break; - case 'INPUT_DOCUMENT': + case 'INPUT_DOCUMENT': if ($noShowTitle == 0) { $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $array ); } $oInputDocument = new InputDocument(); - $Fields = $oInputDocument->load( $_GET['UID'] ); + $Fields = $oInputDocument->load( $_GET['UID'] ); if (! $aPreviousStep) { $Fields['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['PREVIOUS_STEP_LABEL'] = ''; @@ -278,13 +278,13 @@ try { $Fields['NEXT_STEP'] = $aNextStep['PAGE']; $Fields['NEXT_STEP_LABEL'] = G::loadTranslation( "ID_NEXT_STEP" ); switch ($_GET['ACTION']) { - case 'ATTACH': + case 'ATTACH': switch ($Fields['INP_DOC_FORM_NEEDED']) { case 'REAL': $Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_NEW' ); $sXmlForm = 'cases/cases_AttachInputDocument2'; break; - case 'VIRTUAL': + case 'VIRTUAL': $Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_ATTACH' ); $sXmlForm = 'cases/cases_AttachInputDocument1'; break; @@ -319,8 +319,8 @@ try { $oHeadPublisher = & headPublisher::getSingleton(); $titleDocument = "

" . $Fields['INP_DOC_TITLE'] . "
" . G::LoadTranslation( 'ID_INPUT_DOCUMENT' ) . "

"; - if ($Fields['INP_DOC_DESCRIPTION']) { - $titleDocument .= " " . str_replace( "\n", "", str_replace( "'", "\'", nl2br( htmlentities( utf8_decode( $Fields['INP_DOC_DESCRIPTION'] ) ) ) ) ) . ""; + if ($Fields['INP_DOC_DESCRIPTION']) { + $titleDocument .= " " . str_replace( "\n", "", str_replace( "'", "\'", nl2br( html_entity_decode($Fields['INP_DOC_DESCRIPTION'], ENT_COMPAT | ENT_HTML401, "UTF-8") ) ) ) . ""; } $oHeadPublisher->addScriptCode( "documentName='{$titleDocument}';" ); diff --git a/workflow/engine/methods/cases/summary.php b/workflow/engine/methods/cases/summary.php index c0f42affd..bb9430059 100755 --- a/workflow/engine/methods/cases/summary.php +++ b/workflow/engine/methods/cases/summary.php @@ -52,6 +52,7 @@ try { $applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = '#'; $applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = '#'; + $applicationFields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_REQUEST['DYN_UID']; G::LoadClass( 'dbConnections' ); $_SESSION['PROCESS'] = $applicationFields['PRO_UID']; diff --git a/workflow/engine/methods/dynaforms/fields_Save.php b/workflow/engine/methods/dynaforms/fields_Save.php index c9a0c537c..a15c5dc81 100755 --- a/workflow/engine/methods/dynaforms/fields_Save.php +++ b/workflow/engine/methods/dynaforms/fields_Save.php @@ -118,10 +118,10 @@ if (file_exists(PATH_XMLFORM . 'dynaforms/fields/' . $type . '.xml')) { } if ($type === 'grid') { if (!isset($_POST['form']['PME_ADDROW']) || $_POST['form']['PME_ADDROW'] == '') { - $_POST['form']['PME_ADDROW'] = '0'; + $_POST['form']['PME_ADDROW'] = 0; } if (!isset($_POST['form']['PME_DELETEROW']) || $_POST['form']['PME_DELETEROW'] == '') { - $_POST['form']['PME_DELETEROW'] = '0'; + $_POST['form']['PME_DELETEROW'] = 0; } } if ($type === 'dropdown' || $type === 'listbox') { @@ -147,7 +147,7 @@ foreach ($_POST['form'] as $key => $value) { $_POST['form'] = $res; -$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml'); +$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml'); $ses = new DBSession($dbc); $fields = new DynaFormField($dbc); @@ -179,7 +179,7 @@ unset($attributes['PRO_UID']); $options = null; foreach ($attributes as $key => $value) { - if ($key === 'OPTIONS') { + if ($key === 'OPTIONS') { if (is_array($value)) { if (is_array(reset($value))) { $langs = array(); @@ -210,7 +210,7 @@ foreach ($attributes as $key => $value) { } */ } } - } else { + } else { if (is_array($value)) { //Is a list: if (is_string(reset($value))) { @@ -223,14 +223,15 @@ foreach ($attributes as $key => $value) { } unset($attributes['VALIDATE_NAME']); $fields->setFileName(PATH_DYNAFORM . $file . '.xml'); - $FieldAttributes = $attributes; $FieldAttrib = array(); + unset($FieldAttributes['XMLNODE_NAME']); unset($FieldAttributes['XMLNODE_NAME_OLD']); unset($FieldAttributes['XMLNODE_VALUE']); unset($FieldAttributes['BTN_CANCEL']); unset($FieldAttributes['SAVELABEL']); + foreach ($FieldAttributes as $key => $value) { switch (gettype($value)) { case 'string': diff --git a/workflow/engine/methods/events/eventsEdit.php b/workflow/engine/methods/events/eventsEdit.php index 564b40429..4675dde2f 100755 --- a/workflow/engine/methods/events/eventsEdit.php +++ b/workflow/engine/methods/events/eventsEdit.php @@ -64,6 +64,7 @@ $aTriggersFileds[] = array ('TRI_UID' => 'char','TRI_TITLE' => 'char'); foreach ($aTriggersList as $i => $v) { unset( $aTriggersList[$i]['PRO_UID'] ); unset( $aTriggersList[$i]['TRI_DESCRIPTION'] ); + unset( $aTriggersList[$i]['TRI_LOCATE_WEBBOT_PARAM'] ); $aTriggersList[$i]['TRI_TITLE'] = (strlen( $aTriggersList[$i]['TRI_TITLE'] ) > 32) ? substr( $aTriggersList[$i]['TRI_TITLE'], 0, 32 ) . '...' : $aTriggersList[$i]['TRI_TITLE']; } diff --git a/workflow/engine/methods/events/eventsEditAction.php b/workflow/engine/methods/events/eventsEditAction.php index eff7749f3..7ee480b9e 100755 --- a/workflow/engine/methods/events/eventsEditAction.php +++ b/workflow/engine/methods/events/eventsEditAction.php @@ -229,6 +229,7 @@ $_DBArray['triggers'] = $aTriggers; $_SESSION['_DBArray'] = $_DBArray; +$aFields = array_merge($aFields, setLabels()); $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave' ); //$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave'); @@ -239,3 +240,15 @@ function replaceQuotes ($aData) return str_replace( '"', '"e;', $aData ); } +function setLabels () { + $labels = array( + 'LABEL_ADD' => G::LoadTranslation( 'ID_ADD' ), + 'LABEL_ADD_CURRENT' => G::LoadTranslation( 'ID_EVENT_ADD_CURRENT' ), + 'LABEL_ADD_USERS' => G::LoadTranslation( 'ID_EVENT_ADD_USERS' ), + 'LABEL_REMOVED_SELECTED' => G::LoadTranslation( 'ID_EVENT_REMOVE_SELECTED' ), + 'LABEL_ADD_DYNAVAR' => G::LoadTranslation( 'ID_EVENT_ADD_DYNAVAR' ), + 'LABEL_ADD_GROUPS' => G::LoadTranslation( 'ID_EVENT_ADD_GROUPS' ) + ); + return $labels; +} + diff --git a/workflow/engine/methods/events/eventsNew.php b/workflow/engine/methods/events/eventsNew.php index b7b1021c6..8acee21eb 100755 --- a/workflow/engine/methods/events/eventsNew.php +++ b/workflow/engine/methods/events/eventsNew.php @@ -54,6 +54,7 @@ $aTriggersFileds[] = array ("TRI_UID" => "char", "TRI_TITLE" => "char"); foreach ($aTriggersList as $i => $v) { unset( $aTriggersList[$i]['PRO_UID'] ); unset( $aTriggersList[$i]['TRI_DESCRIPTION'] ); + unset( $aTriggersList[$i]['TRI_LOCATE_WEBBOT_PARAM'] ); $aTriggersList[$i]['TRI_TITLE'] = (strlen( $aTriggersList[$i]['TRI_TITLE'] ) > 32) ? substr( $aTriggersList[$i]['TRI_TITLE'], 0, 32 ) . '...' : $aTriggersList[$i]['TRI_TITLE']; } diff --git a/workflow/engine/methods/groups/groups_Ajax.php b/workflow/engine/methods/groups/groups_Ajax.php index 939ffb39e..233e56619 100644 --- a/workflow/engine/methods/groups/groups_Ajax.php +++ b/workflow/engine/methods/groups/groups_Ajax.php @@ -144,7 +144,7 @@ switch ($_POST['action']) { case 'saveNewGroup': G::LoadClass( 'groups' ); $newGroup['GRP_UID'] = ''; - $newGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] ); + $newGroup['GRP_STATUS'] = ($_POST['status'] == '1') ? 'ACTIVE' : 'INACTIVE'; $newGroup['GRP_TITLE'] = trim( $_POST['name'] ); unset( $newGroup['GRP_UID'] ); $group = new Groupwf(); @@ -154,7 +154,7 @@ switch ($_POST['action']) { case 'saveEditGroup': G::LoadClass( 'groups' ); $editGroup['GRP_UID'] = $_POST['grp_uid']; - $editGroup['GRP_STATUS'] = G::toUpper( $_POST['status'] ); + $editGroup['GRP_STATUS'] = ($_POST['status'] == '1') ? 'ACTIVE' : 'INACTIVE'; $editGroup['GRP_TITLE'] = trim( $_POST['name'] ); $group = new Groupwf(); $group->update( $editGroup ); diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 04e9138fb..96e7ab427 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -198,7 +198,7 @@ try { $weblog=new LoginLog(); $aLog['LOG_UID'] = G::generateUniqueID(); $aLog['LOG_STATUS'] = 'ACTIVE'; - $aLog['LOG_IP'] = $_SERVER['REMOTE_ADDR']; + $aLog['LOG_IP'] = G::getIpAddress(); $aLog['LOG_SID'] = session_id(); $aLog['LOG_INIT_DATE'] = date('Y-m-d H:i:s'); //$aLog['LOG_END_DATE'] = '0000-00-00 00:00:00'; diff --git a/workflow/engine/methods/processes/processes_Ajax.php b/workflow/engine/methods/processes/processes_Ajax.php index 775f310e8..e8bb90191 100755 --- a/workflow/engine/methods/processes/processes_Ajax.php +++ b/workflow/engine/methods/processes/processes_Ajax.php @@ -552,15 +552,30 @@ try { $aFields = getDynaformsVars($proUid, $isSystem, isset($_REQUEST['bIncMulSelFields']) ? $_REQUEST['bIncMulSelFields'] : 1); } $aVariables = array(); - foreach ($aFields as $key => $value) { - if ($queryText != '') { - if (stristr($aFields[$key]['sName'], $queryText)) { + + if ($queryText != "") { + foreach ($aFields as $key => $value) { + if (stristr($aFields[$key]["sName"], $queryText)) { $aVariables[] = $aFields[$key]; } - } else { - $aVariables[] = $aFields[$key]; + } + } else { + switch ($_REQUEST["type"]) { + case "system" : + foreach ($aFields as $key => $value) { + if ($aFields[$key]["sType"] == "system") { + $aVariables[] = $aFields[$key]; + } + } + break; + default : + foreach ($aFields as $key => $value) { + $aVariables[] = $aFields[$key]; + } + break; } } + echo Bootstrap::json_encode($aVariables); break; /** diff --git a/workflow/engine/methods/setup/appCacheViewAjax.php b/workflow/engine/methods/setup/appCacheViewAjax.php index e9ed60072..7c82744c1 100755 --- a/workflow/engine/methods/setup/appCacheViewAjax.php +++ b/workflow/engine/methods/setup/appCacheViewAjax.php @@ -138,15 +138,15 @@ switch ($request) { if (! $currentUserIsSuper && ! $result->error) { $res = $appCache->checkGrantsForUser( true ); if (! isset( $res['error'] )) { - $result->info[] = array ('name' => 'Root User','value' => $res['user']); - $result->info[] = array ('name' => 'Root User has SUPER privilege','value' => $res['super']); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_ROOT_USER' ), 'value' => $res['user']); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_ROOT_USER_SUPER' ), 'value' => $res['super']); } else { $result->info[] = array ('name' => 'Error','value' => $res['msg']); } $res = $appCache->setSuperForUser( $currentUser ); if (! isset( $res['error'] )) { - $result->info[] = array ('name' => 'Setting SUPER privilege','value' => 'Successfully'); + $result->info[] = array ('name' => G::LoadTranslation ( 'ID_SETTING_SUPER' ), 'value' => G::LoadTranslation ( 'ID_SUCCESSFULLY' )); } else { $result->error = true; $result->errorMsg = $res['msg']; diff --git a/workflow/engine/methods/users/usersAjax.php b/workflow/engine/methods/users/usersAjax.php index 07d328ea0..b50bae200 100755 --- a/workflow/engine/methods/users/usersAjax.php +++ b/workflow/engine/methods/users/usersAjax.php @@ -89,7 +89,7 @@ switch ($_POST['action']) { G::LoadClass('calendar'); $calendar = new Calendar(); $calendarObj = $calendar->getCalendarList(true, true); - $oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- None -'); + $oData[] = array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '- ' . G::LoadTranslation('ID_NONE') . ' -'); foreach ($calendarObj['array'] as $rowid => $row) { if ($rowid > 0) { $oData[] = array('CALENDAR_UID' => $row['CALENDAR_UID'], 'CALENDAR_NAME' => $row['CALENDAR_NAME']); diff --git a/workflow/engine/methods/users/users_Ajax.php b/workflow/engine/methods/users/users_Ajax.php index 0ae4c9336..adb0d17c2 100644 --- a/workflow/engine/methods/users/users_Ajax.php +++ b/workflow/engine/methods/users/users_Ajax.php @@ -390,7 +390,9 @@ try { $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_EMAIL); + $oCriteria->addSelectColumn(UsersPeer::USR_ROLE); + $oCriteria->addSelectColumn(UsersPeer::USR_DUE_DATE); $oCriteria->addSelectColumn(UsersPeer::USR_STATUS); $oCriteria->addSelectColumn(UsersPeer::USR_UX); @@ -438,21 +440,26 @@ try { $uRole = Array(); while ($oDataset->next()) { $row = $oDataset->getRow(); + try { $uRole = $oRoles->loadByCode($row['USR_ROLE']); } catch (exception $oError) { $uRole['ROL_NAME'] = G::loadTranslation( 'ID_DELETED' ); } + + $row['USR_ROLE_ID'] = $row['USR_ROLE']; $row['USR_ROLE'] = isset($uRole['ROL_NAME']) ? ($uRole['ROL_NAME'] != '' ? $uRole['ROL_NAME'] : $uRole['USR_ROLE']) : $uRole['USR_ROLE']; + $row['DUE_DATE_OK'] = (date('Y-m-d') > date('Y-m-d', strtotime($row['USR_DUE_DATE']))) ? 0 : 1; $row['LAST_LOGIN'] = isset($aLogin[$row['USR_UID']]) ? $aLogin[$row['USR_UID']] : ''; $row['TOTAL_CASES'] = isset($aCases[$row['USR_UID']]) ? $aCases[$row['USR_UID']] : 0; $row['DEP_TITLE'] = isset($aDepart[$row['USR_UID']]) ? $aDepart[$row['USR_UID']] : ''; $row['USR_UX'] = isset($uxList[$row['USR_UX']]) ? $uxList[$row['USR_UX']] : $uxList['NORMAL']; $row['USR_AUTH_SOURCE'] = isset($aAuthSources[$row['USR_UID']]) ? $aAuthSources[$row['USR_UID']] : 'ProcessMaker (MYSQL)'; - + $rows[] = $row; } + echo '{users: ' . G::json_encode($rows) . ', total_users: ' . $totalRows . '}'; break; case 'updatePageSize': diff --git a/workflow/engine/skinEngine/simplified/css/topbar.css b/workflow/engine/skinEngine/simplified/css/topbar.css index dadd76521..c05a0d018 100644 --- a/workflow/engine/skinEngine/simplified/css/topbar.css +++ b/workflow/engine/skinEngine/simplified/css/topbar.css @@ -525,6 +525,9 @@ div.topbar ul.primary-nav li ul { div.topbar ul.secondary-nav li ul { right: 0; } +div.topbar ul.rtl-secondary-nav li ul { + left: 0; +} div.topbar ul li ul li { float: none; clear: both; diff --git a/workflow/engine/templates/admin/uxUsersList.js b/workflow/engine/templates/admin/uxUsersList.js index b24b74865..d707bf816 100755 --- a/workflow/engine/templates/admin/uxUsersList.js +++ b/workflow/engine/templates/admin/uxUsersList.js @@ -78,6 +78,7 @@ Ext.onReady(function(){ {name : 'USR_LASTNAME'}, {name : 'USR_EMAIL'}, {name : 'USR_ROLE'}, + {name : 'USR_ROLE_ID'}, {name : 'USR_DUE_DATE'}, {name : 'DEP_TITLE'}, {name : 'LAST_LOGIN'}, @@ -150,9 +151,9 @@ Ext.onReady(function(){ cmodel = new Ext.grid.ColumnModel({ columns: [ {id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - //{header: '', dataIndex: 'USR_UID', width: 30, align:'center', sortable: false, renderer: photo_user}, {header: _('ID_USER_NAME'), dataIndex: 'USR_USERNAME', width: 90, hidden:false, align:'left'}, {header: _('ID_FULL_NAME'), dataIndex: 'USR_USERNAME', width: 50, align:'left', renderer: full_name}, + {dataIndex: 'USR_ROLE_ID', hidden:true, hideable:false}, {header: _('ID_ROLE'), dataIndex: 'USR_ROLE', width: 50, hidden:false, align:'left'}, {header: _('ID_STATUS'), dataIndex: 'USR_STATUS', width: 50, hidden: true, align: 'center', renderer: render_status}, { @@ -171,12 +172,12 @@ Ext.onReady(function(){ fields: ['id', 'name'], data : uxTypes }), - listeners: { - select: function(a, b) { + listeners: { + select: function(combo, newValue) { var row = usersGrid.getSelectionModel().getSelected(); - role = row.get('USR_ROLE'); + role = row.get('USR_ROLE_ID'); - if (role == 'PROCESSMAKER_ADMIN' && (this.value == 'SIMPLIFIED' || this.value == 'SINGLE')) { + if (role == 'PROCESSMAKER_ADMIN' && (combo.getValue() == 'SIMPLIFIED' || combo.getValue() == 'SINGLE')) { PMExt.warning(_('ID_WARNING'), _('ID_ADMINS_CANT_USE_UXS')); this.setValue('NORMAL'); } diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index 10ccbd145..b8d99fd39 100644 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -483,8 +483,10 @@ Ext.onReady ( function() { style = style + chain; } } + + data = Ext.util.Format.htmlEncode(data); metadata.attr = 'ext:qtip="' + data + '" style="'+ style +' white-space: normal; "'; - return Ext.util.Format.htmlEncode(data); + return data; }; function openLink(value, p, r){ @@ -545,9 +547,9 @@ Ext.onReady ( function() { function renderNote(val,p,r) { pro = r.json.PRO_UID; tas = r.json.TAS_UID; - appUid = r.data['APP_UID']; - title = r.data['APP_TITLE']; + title = Ext.util.Format.htmlEncode(r.data['APP_TITLE']); + return ''; } diff --git a/workflow/engine/templates/cases/main.js b/workflow/engine/templates/cases/main.js index ae66d9928..e9dd0ac25 100755 --- a/workflow/engine/templates/cases/main.js +++ b/workflow/engine/templates/cases/main.js @@ -359,8 +359,8 @@ Ext.onReady(function(){ store: triggerStore, columns: [ - {id:'name',header: "Name", width: 60, sortable: true, dataIndex: 'name'}, - {header: "Execution", width: 30, sortable: true, dataIndex: 'execution_time'}, + {id:'name',header: _('ID_NAME'), width: 60, sortable: true, dataIndex: 'name'}, + {header: _('ID_EXECUTION'), width: 30, sortable: true, dataIndex: 'execution_time'}, {header: "Code", width: 30, sortable: false, dataIndex: 'code', hidden: true} ], diff --git a/workflow/engine/templates/cases/open.js b/workflow/engine/templates/cases/open.js index 216c68e95..45bd27203 100755 --- a/workflow/engine/templates/cases/open.js +++ b/workflow/engine/templates/cases/open.js @@ -241,53 +241,64 @@ Ext.onReady(function(){ if (swForm == 1) { var requiredField = ""; var swRequiredField = 1; + var dynaformChange =""; + var swDynaformChange = 0; + + if (window.frames["openCaseFrame"].document.getElementsByTagName("form")) { + dynaformChange = window.frames["openCaseFrame"].document.getElementsByTagName("form").item(0); + swDynaformChange = (window.frames["openCaseFrame"].dynaFormChanged(dynaformChange))? 1 : 0; + } if (window.frames["openCaseFrame"].document.getElementById("DynaformRequiredFields")) { requiredField = window.frames["openCaseFrame"].document.getElementById("DynaformRequiredFields").value; - if (requiredField != "") { swRequiredField = (window.frames["openCaseFrame"].validateForm(requiredField))? 1 : 0; } } - if (swRequiredField == 1) { - Ext.MessageBox.show({ - title: _("ID_CONFIRM"), - msg: _("ID_DYNAFORM_SAVE_CHANGES"), - icon: Ext.MessageBox.QUESTION, - buttons: {ok: _("ID_ACCEPT"), cancel: _("ID_CANCEL")}, - fn: function (btn) - { - loadMaskStep.show(); + if (swRequiredField == 1){ + if (swDynaformChange) { + Ext.MessageBox.show({ + title: _("ID_CONFIRM"), + msg: _("ID_DYNAFORM_SAVE_CHANGES"), + icon: Ext.MessageBox.QUESTION, + buttons: {ok: _("ID_ACCEPT"), cancel: _("ID_CANCEL")}, + fn: function (btn) + { + loadMaskStep.show(); - if (btn == "ok") { - var frm = window.frames["openCaseFrame"].document.getElementsByTagName("form"); + if (btn == "ok") { + var frm = window.frames["openCaseFrame"].document.getElementsByTagName("form"); - if (frm.length > 0) { - var result = window.frames["openCaseFrame"].ajax_post( - frm[0].action.replace("cases_SaveData", "saveForm"), - frm[0], - "POST", - function (responseText) - { - //Set URL and redirect - document.getElementById("openCaseFrame").src = node.attributes.url; - }, - true - ); - } else { - //Set URL and redirect - document.getElementById("openCaseFrame").src = node.attributes.url; - } - } else { - //Set URL and redirect - document.getElementById("openCaseFrame").src = node.attributes.url; - } - } - }); - } else { - swNodeCurrentSelect = 1; - } + if (frm.length > 0) { + var result = window.frames["openCaseFrame"].ajax_post( + frm[0].action.replace("cases_SaveData", "saveForm"), + frm[0], + "POST", + function (responseText) + { + //Set URL and redirect + document.getElementById("openCaseFrame").src = node.attributes.url; + }, + true + ); + } else { + //Set URL and redirect + document.getElementById("openCaseFrame").src = node.attributes.url; + } + } else { + //Set URL and redirect + document.getElementById("openCaseFrame").src = node.attributes.url; + } + } + }); + } else { + loadMaskStep.show(); + document.getElementById("openCaseFrame").src = node.attributes.url; + } + } else { + swNodeCurrentSelect = 1; + } } else { loadMaskStep.show(); diff --git a/workflow/engine/templates/dynaforms/fieldsHandler.php b/workflow/engine/templates/dynaforms/fieldsHandler.php index ecc665d7c..db984e499 100755 --- a/workflow/engine/templates/dynaforms/fieldsHandler.php +++ b/workflow/engine/templates/dynaforms/fieldsHandler.php @@ -87,7 +87,7 @@ diff --git a/workflow/engine/templates/events/sendMessage.tpl b/workflow/engine/templates/events/sendMessage.tpl index f3fa7a1cc..08b694f5f 100755 --- a/workflow/engine/templates/events/sendMessage.tpl +++ b/workflow/engine/templates/events/sendMessage.tpl @@ -1,6 +1,6 @@ /* * Autogenerated by Processmaker Daemon System - * + * * Generic Send Message trigger * {timestamp} */ @@ -9,11 +9,11 @@ $sRecipientTO = "{TO}"; $sRecipientCC = "{CC}"; $sRecipientBCC = "{BCC}"; -/*Composing the message using PMFgetUserEmailAddress() PM function*/ +/*Composing the message using PMFGetUserEmailAddress() PM function*/ $from = '{from}'; -$to = PMFgetUserEmailAddress($sRecipientTO, @@APPLICATION); -$cc = PMFgetUserEmailAddress($sRecipientCC, @@APPLICATION); -$bcc = PMFgetUserEmailAddress($sRecipientBCC, @@APPLICATION); +$to = PMFGetUserEmailAddress($sRecipientTO, @@APPLICATION); +$cc = PMFGetUserEmailAddress($sRecipientCC, @@APPLICATION); +$bcc = PMFGetUserEmailAddress($sRecipientBCC, @@APPLICATION); $subject = '{subject}'; $template = '{template}'; diff --git a/workflow/engine/templates/groups/groupsList.js b/workflow/engine/templates/groups/groupsList.js index 4b4ec287d..b9d0e1908 100755 --- a/workflow/engine/templates/groups/groupsList.js +++ b/workflow/engine/templates/groups/groupsList.js @@ -144,8 +144,8 @@ Ext.onReady(function(){ }); comboStatusStore = new Ext.data.SimpleStore({ - fields: ['id','value'], - data: [['1','ACTIVE'],['0','INACTIVE']] + fields: ['changeInt','value'], + data: [['1',_('ID_ACTIVE').toUpperCase()],['0', _('ID_INACTIVE').toUpperCase()]] }); newForm = new Ext.FormPanel({ @@ -164,11 +164,11 @@ Ext.onReady(function(){ store: comboStatusStore, listeners : { beforerender: function(status){ - status.setValue('ACTIVE'); + status.setValue('1'); } }, displayField: 'value', - valueField:'value', + valueField:'changeInt', allowBlank: false, triggerAction: 'all', emptyText: _('ID_SELECT_STATUS'), @@ -189,13 +189,15 @@ Ext.onReady(function(){ {xtype: 'textfield', fieldLabel: _('ID_GROUP_NAME'), name: 'name', width: 200, allowBlank: false}, { xtype: 'combo', + id: 'statusEdit', + name: 'statusEdit', fieldLabel: _('ID_STATUS'), hiddenName: 'status', typeAhead: true, mode: 'local', store: comboStatusStore, displayField: 'value', - valueField:'value', + valueField:'changeInt', allowBlank: false, editable:false, triggerAction: 'all', @@ -409,6 +411,7 @@ DuplicateGroupName = function(){ //Save New Group SaveNewGroup = function(){ + document.getElementById('status').value = Ext.getCmp('status').getValue(); newForm.getForm().submit({ waitTitle : " ", success: function(f,a){ @@ -438,7 +441,8 @@ EditGroupWindow = function(){ editForm.getForm().findField('grp_uid').setValue(rowSelected.data.GRP_UID); editForm.getForm().findField('name').setValue(strName); - editForm.getForm().findField('status').setValue(rowSelected.data.GRP_STATUS); + var valueEditChangeInt = (rowSelected.data.GRP_STATUS == 'ACTIVE') ? '1' : '0'; + editForm.getForm().findField('status').setValue(valueEditChangeInt); w = new Ext.Window({ autoHeight: true, width: 440, @@ -467,6 +471,7 @@ SaveEditGroupAction = function(){ //Save Edit Group SaveEditGroup = function(){ + document.getElementById('statusEdit').value = Ext.getCmp('statusEdit').getValue(); editForm.getForm().submit({ waitTitle : " ", success: function(f,a){ diff --git a/workflow/engine/templates/home/index.html b/workflow/engine/templates/home/index.html index 6ff61e37b..000059de2 100644 --- a/workflow/engine/templates/home/index.html +++ b/workflow/engine/templates/home/index.html @@ -136,14 +136,16 @@ {/if} - -
- +
- - - + + + - - - + + + @@ -86,14 +86,14 @@
{$form.EVN_MESSAGE_TO_TO_SIMPLEADD}
{$form.EVN_MESSAGE_TO_TO}
 
- - - + + + - - - + + + @@ -111,14 +111,14 @@
{$form.EVN_MESSAGE_TO_CC_SIMPLEADD}
{$form.EVN_MESSAGE_TO_CC}
 
- - - + + + - - - + + + @@ -141,6 +141,14 @@
{$form.EVN_MESSAGE_TO_BCC_SIMPLEADD}
{$form.EVN_MESSAGE_TO_BCC}
 
+
+ {$form.LABEL_ADD} + {$form.LABEL_ADD_CURRENT} + {$form.LABEL_ADD_USERS} + {$form.LABEL_REMOVED_SELECTED} + {$form.LABEL_ADD_DYNAVAR} + {$form.LABEL_ADD_GROUPS} +
* {php}echo (G::LoadTranslation('ID_REQUIRED_FIELD'));{/php}
diff --git a/workflow/engine/xmlform/events/eventsEditAction.xml b/workflow/engine/xmlform/events/eventsEditAction.xml index 527b249b8..370fdab0e 100755 --- a/workflow/engine/xmlform/events/eventsEditAction.xml +++ b/workflow/engine/xmlform/events/eventsEditAction.xml @@ -83,6 +83,14 @@ SELECT TRI_UID, TRI_TITLE FROM triggers Save + + + + + + + + \ No newline at end of file diff --git a/workflow/engine/xmlform/outputdocs/outputdocs_Properties.html b/workflow/engine/xmlform/outputdocs/outputdocs_Properties.html index 1e77f0630..5ddcafa58 100755 --- a/workflow/engine/xmlform/outputdocs/outputdocs_Properties.html +++ b/workflow/engine/xmlform/outputdocs/outputdocs_Properties.html @@ -124,6 +124,10 @@ {$form.OUT_DOC_TAGS} + + {$OUT_DOC_OPEN_TYPE} + {$form.OUT_DOC_OPEN_TYPE} + diff --git a/workflow/engine/xmlform/outputdocs/outputdocs_Properties.xml b/workflow/engine/xmlform/outputdocs/outputdocs_Properties.xml index 055be1be2..68bc82010 100755 --- a/workflow/engine/xmlform/outputdocs/outputdocs_Properties.xml +++ b/workflow/engine/xmlform/outputdocs/outputdocs_Properties.xml @@ -103,6 +103,9 @@ + + By clicking on the generated file link + Cancel @@ -194,7 +197,6 @@ var verifyTitle = function(oForm) } - function cancel(){ currentPopupWindow.remove(); } diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 3f98d190d..a6e646555 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -72,6 +72,11 @@ function transactionLog($transactionName){ } } +// Validating if exists 'HTTP_USER_AGENT' key in $_SERVER array +if (!isset($_SERVER['HTTP_USER_AGENT'])) { + $_SERVER['HTTP_USER_AGENT'] = ''; +} + // Defining the PATH_SEP constant, he we are defining if the the path separator symbol will be '\\' or '/' define( 'PATH_SEP', '/' );