Commit 8bb56bdf authored by Damien's avatar Damien

Merge branch 'develop' into 'master'

Develop

See merge request maarch/MaarchCourrier!208
parents cf15de44 0eb235f6
......@@ -30,25 +30,25 @@ before_script:
- bash ci/docker_install_php.sh > /dev/null
- bash ci/docker_install_database.sh > /dev/null
# job_php-7.4:
# image: php:7.4-apache
# stage: test
# script:
# - mkdir -p /opt/maarch/docservers/indexes/{letterbox_coll,attachments_coll,version_attachments_coll}
# - mkdir -p /opt/maarch/docservers/{ai,manual,manual_attachments,templates}
# - mkdir -p /opt/maarch/docservers/{convert_attachments,convert_attachments_version,convert_mlb}
# - mkdir -p /opt/maarch/docservers/{fulltext_attachments,fulltext_attachments_version,fulltext_mlb}
# - mkdir -p /opt/maarch/docservers/{thumbnails_attachments,thumbnails_attachments_version,thumbnails_mlb}
# - mkdir -p /var/www/html/
# - cp -R /builds/maarch/MaarchCourrier/ /var/www/html/
# - cd /var/www/html/MaarchCourrier
# - mkdir -p /var/www/html/MaarchCourrier
# - sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml
# - curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
# - chmod +x /usr/local/bin/phpunit
# - phpunit --no-coverage
# only:
# - develop
job_php-7.4:
image: php:7.4-apache
stage: test
script:
- mkdir -p /opt/maarch/docservers/indexes/{letterbox_coll,attachments_coll,version_attachments_coll}
- mkdir -p /opt/maarch/docservers/{ai,manual,manual_attachments,templates}
- mkdir -p /opt/maarch/docservers/{convert_attachments,convert_attachments_version,convert_mlb}
- mkdir -p /opt/maarch/docservers/{fulltext_attachments,fulltext_attachments_version,fulltext_mlb}
- mkdir -p /opt/maarch/docservers/{thumbnails_attachments,thumbnails_attachments_version,thumbnails_mlb}
- mkdir -p /var/www/html/
- cp -R /builds/maarch/MaarchCourrier/ /var/www/html/
- cd /var/www/html/MaarchCourrier
- mkdir -p /var/www/html/MaarchCourrier
- sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-8.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never -c phpunit.xml
only:
- develop
job_php-7.3:
image: php:7.3-apache
......@@ -66,7 +66,7 @@ job_php-7.3:
- sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-8.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --no-coverage
- phpunit --coverage-text --colors=never -c phpunit.xml
only:
- develop
......@@ -91,6 +91,6 @@ job_php-7.2:
- sed 's/<databaseserver>.*<\/databaseserver>/<databaseserver>postgres<\/databaseserver>/;s/<databasepassword>.*<\/databasepassword>/<databasepassword><\/databasepassword>/;s/<databasename>.*<\/databasename>/<databasename>MaarchCourrier<\/databasename>/;s/<databaseuser>.*<\/databaseuser>/<databaseuser>maarch<\/databaseuser>/' apps/maarch_entreprise/xml/config.xml.default > apps/maarch_entreprise/xml/config.xml
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-8.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --no-coverage
- phpunit --coverage-text --colors=never -c phpunit.xml
only:
- develop
<?php
/**
* Copyright Maarch since 2008 under licence GPLv3.
* See LICENCE.txt file at the root folder for more details.
* This file is part of Maarch software.
*
* @brief sendToExternalSignatureBok
*
* @author dev <dev@maarch.org>
* @ingroup visa
*/
$confirm = true;
$frm_width = '400px';
$frm_height = 'auto';
$warnMsg = '';
$etapes = ['form'];
$config = getXml();
if (!empty($config) && $config['id'] != 'maarchParapheur') {
$hasAttachmentError = hasAttachmentError();
$error_visa_workflow_signature_book = $hasAttachmentError['error'];
}
function get_form_txt($values, $path_manage_action, $id_action, $table, $module, $coll_id, $mode)
{
$db = new Database();
$values_str = '';
if (empty($_SESSION['stockCheckbox'])) {
for ($i=0; $i<count($values); $i++) {
$values_str .= $values[$i].', ';
}
} else {
for ($i=0; $i<count($_SESSION['stockCheckbox']); $i++) {
$values_str .= $_SESSION['stockCheckbox'][$i].', ';
}
}
$values_str = preg_replace('/, $/', '', $values_str);
$config = getXml();
$labelAction = '';
if ($id_action <> '') {
$stmt = $db->query("SELECT label_action FROM actions WHERE id = ?", array($id_action));
$resAction = $stmt->fetchObject();
$labelAction = functions::show_string($resAction->label_action);
}
$html = '<div id="frm_error_'.$id_action.'" class="error"></div>';
$html .= '<h2 class="title">'._ACTION_CONFIRM. '<br>' . $labelAction . '</h2>';
$html .= '<form name="sendToExternalSB" id="sendToExternalSB" method="post" class="forms" action="#">';
$html .= '<input type="hidden" name="chosen_action" id="chosen_action" value="end_action" />';
$htmlModal = '';
if (!empty($config)) {
if ($config['id'] == 'ixbus') {
include_once 'modules/visa/class/IxbusController.php';
$htmlModal = IxbusController::getModal($config);
} elseif ($config['id'] == 'iParapheur') {
// Already In V2
} elseif ($config['id'] == 'fastParapheur') {
// Already In V2
} elseif ($config['id'] == 'maarchParapheur') {
// Already in V2
}
if (!empty($htmlModal['error'])) {
$error = $htmlModal['error'];
} else {
$html .= $htmlModal;
}
} else {
$error = _FILE . ' modules/visa/xml/remoteSignatoryBooks.xml' . ' ' . _NOT_EXISTS;
}
$html .='<div align="center">';
if (empty($error)) {
$html .=' <input type="button" name="validate" id="validate" value="'._VALIDATE.'" class="button" ' .
'onclick="valid_action_form(\'sendToExternalSB\', \'' . $path_manage_action .
'\', \'' . $id_action . '\', \'' . $values_str . '\', \'res_letterbox\', \'null\', \'letterbox_coll\', \'' .
$mode . '\');" />&nbsp;';
} else {
$html .= '<br>' . $error . '<br><br>';
}
$html .='<input type="button" name="cancel" id="cancel" class="button" value="'._CANCEL.'" onclick="pile_actions.action_pop();destroyModal(\'modal_'.$id_action.'\');"/>';
$html .='</div>';
$html .='</form>';
return addslashes($html);
}
function check_form($form_id, $values)
{
$_SESSION['action_error'] = '';
$config = getXml();
if (!empty($config)) {
if ($config['id'] == 'ixbus') {
include_once 'modules/visa/class/IxbusController.php';
$loginIxbus = get_value_fields($values, 'loginIxbus');
$passwordIxbus = get_value_fields($values, 'passwordIxbus');
$userInfo = IxbusController::getInfoUtilisateur(['config' => $config, 'login' => $loginIxbus, 'password' => $passwordIxbus]);
if (!empty($userInfo->Identifiant)) {
return true;
} else {
$_SESSION['action_error'] = _WRONG_ID_PASSWORD_IXBUS;
return false;
}
}
if ($config['id'] == 'maarchParapheur') {
// Already in V2
}
}
return true;
}
function manage_form($arr_id, $history, $id_action, $label_action, $status, $coll_id, $table, $values_form)
{
$result = '';
$config = getXml();
require_once "modules/visa/class/class_modules_tools.php";
$circuit_visa = new visa();
$db = new Database();
$coll_id = $_SESSION['current_basket']['coll_id'];
$message = '';
foreach ($arr_id as $res_id) {
$result .= $res_id.'#';
if (!empty($config)) {
if ($config['id'] == 'ixbus') {
include_once 'modules/visa/class/IxbusController.php';
$loginIxbus = get_value_fields($values_form, 'loginIxbus');
$passwordIxbus = get_value_fields($values_form, 'passwordIxbus');
$nature = get_value_fields($values_form, 'nature');
$messageModel = get_value_fields($values_form, 'messageModel');
$manSignature = get_value_fields($values_form, 'mansignature');
$attachmentToFreeze = IxbusController::sendDatas([
'config' => $config, 'resIdMaster' => $res_id,
'loginIxbus' => $loginIxbus,
'passwordIxbus' => $passwordIxbus,
'classeurName' => $nature,
'messageModel' => $messageModel,
'manSignature' => $manSignature
]);
} elseif ($config['id'] == 'iParapheur') {
// Already In V2
} elseif ($config['id'] == 'fastParapheur') {
// Already In V2
} elseif ($config['id'] == 'maarchParapheur') {
// Already In V2
}
}
if (!empty($attachmentToFreeze)) {
if (!empty($attachmentToFreeze['attachments_coll'])) {
foreach ($attachmentToFreeze['attachments_coll'] as $resId => $externalId) {
\Attachment\models\AttachmentModel::freezeAttachment([
'resId' => $resId,
'table' => 'res_attachments',
'externalId' => $externalId
]);
}
}
}
}
return ['result' => $result, 'history_msg' => $message];
}
function getXml()
{
if (file_exists("custom/{$_SESSION['custom_override_id']}/modules/visa/xml/remoteSignatoryBooks.xml")) {
$path = "custom/{$_SESSION['custom_override_id']}/modules/visa/xml/remoteSignatoryBooks.xml";
} else {
$path = 'modules/visa/xml/remoteSignatoryBooks.xml';
}
$config = [];
if (file_exists($path)) {
$loadedXml = simplexml_load_file($path);
if ($loadedXml) {
$config['id'] = (string)$loadedXml->signatoryBookEnabled;
foreach ($loadedXml->signatoryBook as $value) {
if ($value->id == $config['id']) {
$config['data'] = (array)$value;
}
}
}
}
return $config;
}
/**
* Get the value of a given field in the values returned by the form
*
* @param $values Array Values of the form to check
* @param $field String the field
* @return String the value, false if the field is not found
**/
function get_value_fields($values, $field)
{
for ($i=0; $i<count($values); $i++) {
if ($values[$i]['ID'] == $field) {
return $values[$i]['VALUE'];
}
}
return false;
}
function hasAttachmentError()
{
if (!empty($_SESSION['stockCheckbox'])) {
$resIds = $_SESSION['stockCheckbox'];
} else {
$resIds = [$_SESSION['doc_id']];
}
$noAttachment = [];
foreach ($resIds as $resId) {
$attachments = \Attachment\models\AttachmentModel::get([
'select' => [
'count(1) as nb'
],
'where' => ["res_id_master = ?", "attachment_type not in (?)", "status not in ('DEL', 'OBS', 'FRZ', 'TMP')", "in_signature_book = 'true'"],
'data' => [$resId, ['converted_pdf', 'print_folder', 'signed_response']]
]);
if ($attachments[0]['nb'] == 0) {
$noAttachmentsResource = \Resource\models\ResModel::getById(['resId' => $resId, 'select' => ['alt_identifier']]);
$noAttachment[] = $noAttachmentsResource['alt_identifier'];
}
}
if (!empty($noAttachment)) {
$errorVisaWorkflowSignatureBook = true;
} else {
$errorVisaWorkflowSignatureBook = false;
}
return ['error' => $errorVisaWorkflowSignatureBook, 'resList' => $noAttachment];
}
<?php
/*
* Copyright 2008-2015 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Chrono number Class
*
* Contains all the specific functions of chrono number
*
* @package Maarch LetterBox 3.0
* @version 3.0
* @since 06/2007
* @license GPL
*
*/
require_once 'apps/'. $_SESSION['config']['app_id'] .'/class/class_chrono_Abstract.php';
class chrono extends chrono_Abstract
{
// custom
}
This diff is collapsed.
......@@ -17,76 +17,6 @@ abstract class indexing_searching_app_Abstract extends Database
parent::__construct();
}
public function show_index_frame($ext)
{
if (empty($ext)) {
return false;
}
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
foreach ($xmlconfig->FORMAT as $FORMAT) {
if (strtoupper($ext) == (string) $FORMAT->name) {
if ($FORMAT->canConvert == 'true') {
return true;
} else {
return false;
}
}
}
return false;
}
public function filetypes_showed_indexation()
{
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
$ext_list = array();
foreach ($xmlconfig->FORMAT as $FORMAT) {
if ((string) $FORMAT->canConvert == 'true') {
array_push($ext_list, (string) $FORMAT->name);
}
}
return $ext_list;
}
public function get_mime_type($ext)
{
if (file_exists($_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml')) {
$path = $_SESSION['config']['corepath'].'custom'.DIRECTORY_SEPARATOR.$_SESSION['custom_override_id'].DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
} else {
$path = 'apps'.DIRECTORY_SEPARATOR.$_SESSION['config']['app_id'].DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR.'extensions.xml';
}
$xmlconfig = simplexml_load_file($path);
$ext_list = array();
$i = 0;
foreach ($xmlconfig->FORMAT as $FORMAT) {
$ext_list[$i] = array('name' => (string) $FORMAT->name, 'mime' => (string) $FORMAT->mime);
++$i;
}
for ($i = 0; $i < count($ext_list); ++$i) {
if ($ext_list[$i]['name'] == strtoupper($ext)) {
$mime_type = $ext_list[$i]['mime'];
$type_state = true;
$i = count($ext_list);
return $mime_type;
break;
}
}
return false;
}
public function send_criteria_data($param)
{
/*list_criteres = Array ("num_courrier" => Array (label => "reference courrier',
......
......@@ -675,11 +675,10 @@ if ($mode == 'normal') {
}
if ($tab[$i][$j][$value] == 'count_attachment') {
$excludeAttachmentTypes = ['converted_pdf', 'print_folder'];
$query = "SELECT count(res_id) as total FROM res_attachments
WHERE res_id_master = ?
AND status NOT IN ('DEL', 'OBS') AND attachment_type NOT IN (?) AND (status <> 'TMP' or (typist = ? and status = 'TMP'))";
$arrayPDO = array($tab[$i][0]['res_id'], $excludeAttachmentTypes, $_SESSION['user']['UserId']);
AND status NOT IN ('DEL', 'OBS') AND (status <> 'TMP' or (typist = ? and status = 'TMP'))";
$arrayPDO = array($tab[$i][0]['res_id'], $_SESSION['user']['UserId']);
$stmt2 = $db->query($query, $arrayPDO);
$return_count = $stmt2->fetchObject();
......
......@@ -355,7 +355,7 @@ where lower(translate(folders.label , 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ
array_splice($tmpArray, 0, 1);
$_SESSION['fullTextAttachments']['attachments'] = array_filter($tmpArray);
$db = new Database();
$stmt = $db->query("SELECT DISTINCT res_id_master FROM res_attachments WHERE res_id IN ($Liste_Ids) AND status NOT IN ('DEL','OBS','TMP') AND attachment_type NOT IN ('print_folder')");
$stmt = $db->query("SELECT DISTINCT res_id_master FROM res_attachments WHERE res_id IN ($Liste_Ids) AND status NOT IN ('DEL','OBS','TMP')");
$idMasterDatas = [];
while ($tmp = $stmt->fetchObject()) {
$idMasterDatas[] = $tmp;
......
......@@ -870,210 +870,6 @@ function close_action(id_action, page, path_manage_script, mode_req, res_id_valu
}
/**
* Validates the form of an action
*
* @param current_form_id String Identifier of the form to validate
* @param path_manage_script String Path to the php script called in the Ajax object to validates the form
* @param id_action String Action identifier
* @param values String Action do something on theses items listed in this string
* @param table String Table used for the action
* @param module String Action is this module
* @param coll_id String Collection identifier
* @param mode String Action mode : mass or page
* @param protect_string bool
*/
function valid_action_form(current_form_id, path_manage_script, id_action, values, table, module, coll_id, mode, protect_string, advancedMode) {
var frm_values;
var chosen_action_id;
if (typeof advancedMode !== "undefined") {
frm_values = "so#use#less"; // Sert juste a remplir frm_values pour manage_actions
chosen_action_id = advancedMode[0];
} else {
frm_values = get_form_values(current_form_id);
chosen_action_id = get_chosen_action(current_form_id);
}
if (protect_string != false) {
frm_values = frm_values.replace(/\'/g, "\\'");
frm_values = frm_values.replace(/\"/g, '\\"');
frm_values = frm_values.replace(/\r\n/g, ' ');
frm_values = frm_values.replace(/\r/g, ' ');
frm_values = frm_values.replace(/\n/g, ' ');
}
if (values && table && module && coll_id && chosen_action_id != '') {
new Ajax.Request(path_manage_script, {
method: 'post',
parameters: {
action_id: id_action,
form_to_check: current_form_id,
req: 'valid_form',
form_values: frm_values
},
onCreate: function (answer) {
//show loading image in toolbar
$j("input[type='button']").prop("disabled", true).css("opacity", "0.5");
},
onSuccess: function (answer) {
eval('response=' + answer.responseText);
if (response.status == 0) { //form values checked
var hist = '';
if (chosen_action_id == 'end_action') {
hist = 'Y';
} else {
hist = 'N';
}
if (response.manage_form_now == false) {
pile_actions.action_push("action_send_form_confirm_result( '" + path_manage_script + "', '" + mode + "', '" + id_action + "', '" + values + "','" + table + "', '" + module + "','" + coll_id + "', '" + frm_values + "', '" + hist + "');");
if (chosen_action_id == 'end_action') {
end_actions();
} else {
action_send_first_request(path_manage_script, mode, chosen_action_id, values, table, module, coll_id);
}
} else {
if (chosen_action_id != 'end_action') {
pile_actions.action_push("action_send_first_request( '" + path_manage_script + "', '" + mode + "', '" + chosen_action_id + "', 'to_define','" + table + "', '" + module + "','" + coll_id + "');");
}
action_send_form_confirm_result(path_manage_script, mode, id_action, values, table, module, coll_id, frm_values, hist);
}
} else { // Form Params errors
try {
$('frm_error_' + id_action).innerHTML = response.error_txt;
alert($('frm_error_' + id_action).innerHTML);
$j("input[type='button']").prop("disabled", false).css("opacity", "1");
} catch (e) {
}
}
},
onFailure: function (error) {
console.log(error);
}
});
} else if (chosen_action_id == '') {
alert('Aucune action choisie');
} else {
console.log('Action Error!');
}
}
/**
* Get the chosen action identifier in the form
*
* @param form_id String Identifier of the form
*/
function get_chosen_action(form_id) {
var frm = $(form_id);
for (var i = 0; i < frm.elements.length; i++) {
if (frm.elements[i].id == 'chosen_action') {
if (frm.elements[i].tagName == 'INPUT') {
return frm.elements[i].value;
} else if (frm.elements[i].tagName == 'SELECT') {
return frm.elements[i].options[frm.elements[i].selectedIndex].value;
} else {
break;
}
}
}
return '';
}
/**
* Get the values of the form in an string (Id_field1#field_value1$$Id_field2#field_value2$$)
*
* @param form_id String Identifier of the form
* @return String Values of the form
*/
function get_form_values(form_id, return_string, include_buttons) {
if (typeof (return_string) == "undefined" || return_string === null) {
var in_string = true;
} else {
var in_string = return_string;
}
if (typeof (include_buttons) == "undefined" || include_buttons === null) {
var get_buttons = true;
} else {
var get_buttons = include_buttons;
}
var frm = $(form_id);
if (in_string == true) {
var val = '';
} else {
var val = {};
}
if (frm) {
for (var i = 0; i < frm.elements.length; i++) {
if (frm.elements[i].tagName == 'INPUT' || frm.elements[i].tagName == 'TEXTAREA') {
if ((frm.elements[i].tagName == 'INPUT' && frm.elements[i].type != 'checkbox' && frm.elements[i].type != 'radio') || frm.elements[i].tagName == 'TEXTAREA') {
if ((frm.elements[i].tagName == 'INPUT' && (get_buttons == true || (get_buttons == false && frm.elements[i].type == 'text'))) || frm.elements[i].tagName == 'TEXTAREA') {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].value + '$$';
} else {
val[frm.elements[i].id] = frm.elements[i].value;
}
}
} else {
if (frm.elements[i].checked == true) {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].value + '$$';
} else {
val[frm.elements[i].id] = frm.elements[i].value;
}
}
}
} else if (frm.elements[i].tagName == 'SELECT') {
if (frm.elements[i].type != 'select-multiple') {
if (in_string == true) {
val += frm.elements[i].id + '#' + frm.elements[i].options[frm.elements[i].selectedIndex].value + '$$';
} else {