From 10dfc59b514510ca9a63f3366deb31273dcf15c5 Mon Sep 17 00:00:00 2001 From: satish <satish.dvnk@vtiger.com> Date: Tue, 22 Aug 2017 19:30:49 +0530 Subject: [PATCH] Supporting Webform attachments --- include/Webservices/AddRelated.php | 60 +++++ modules/Migration/schema/701_to_710.php | 15 ++ .../languages/en_us/Settings/Webforms.php | 9 + .../Settings/Webforms/FieldsDetailView.tpl | 199 ++++++++------ .../Settings/Webforms/FieldsEditView.tpl | 58 +++++ .../v7/modules/Settings/Webforms/ShowForm.tpl | 244 +++++++++--------- .../Settings/Webforms/resources/Detail.js | 45 +++- .../Settings/Webforms/resources/Edit.js | 55 ++++ .../Settings/Webforms/resources/List.js | 47 +++- .../Settings/Webforms/uitypes/Picklist.tpl | 38 +++ .../Webforms/modules/Webforms/capture.php | 2 + .../modules/Webforms/model/WebformsModel.php | 58 ++++- .../Webforms/settings/actions/Save.php | 6 + .../Webforms/settings/models/Module.php | 5 + .../Webforms/settings/models/Record.php | 36 +++ .../Webforms/settings/views/Detail.php | 1 + .../modules/Webforms/settings/views/Edit.php | 4 +- .../settings/views/GetSourceModuleFields.php | 4 + .../Webforms/settings/views/ShowForm.php | 2 + .../modules/Settings/Webforms.php | 10 + .../modules/Settings/Webforms.php | 9 + .../modules/Settings/Webforms.php | 9 + .../Deutsch/modules/Settings/Webforms.php | 9 + .../Dutch/modules/Settings/Webforms.php | 9 + .../French/modules/Settings/Webforms.php | 9 + .../Hungarian/modules/Settings/Webforms.php | 9 + .../modules/Settings/Webforms.php | 11 +- .../modules/Settings/Webforms.php | 9 + .../modules/Settings/Webforms.php | 10 + .../modules/Settings/Webforms.php | 9 + .../Russian/modules/Settings/Webforms.php | 9 + .../Spanish/modules/Settings/Webforms.php | 9 + .../modules/Settings/Webforms.php | 10 + .../modules/Settings/Webforms.php | 9 + vtlib/Vtiger/Functions.php | 22 ++ 35 files changed, 845 insertions(+), 205 deletions(-) create mode 100644 include/Webservices/AddRelated.php create mode 100644 pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/uitypes/Picklist.tpl diff --git a/include/Webservices/AddRelated.php b/include/Webservices/AddRelated.php new file mode 100644 index 000000000..699d46364 --- /dev/null +++ b/include/Webservices/AddRelated.php @@ -0,0 +1,60 @@ +<?php +/* +********************************************************************************** + * The contents of this file are subject to the vtiger CRM Public License Version 1.1 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * ***********************************************************************************/ + +/** + * Function to relate CRM records for relationships exists in vtiger_relatedlists table. + * @param $sourceRecordId - Source record webservice id. + * @param $relatedRecordId - Related record webservice id(s). One record id or array of ids for same module. + * @param $relationIdLabel - Relation id or label as in vtiger_relatedlists table. + * @param $user + */ +function vtws_add_related($sourceRecordId, $relatedRecordId, $relationIdLabel = false, $user = false) { + $db = PearDatabase::getInstance(); + if (!is_array($relatedRecordId)) { + $relatedRecordId = array($relatedRecordId); + } + + $sourceRecordIdParts = vtws_getIdComponents($sourceRecordId); + $relatedRecordIdParts = vtws_getIdComponents($relatedRecordId[0]); + if (!isRecordExists($sourceRecordIdParts[1])) { + throw new Exception("Source record $sourceRecordIdParts is deleted"); + } + + try { + $sourceRecordWsObject = VtigerWebserviceObject::fromId($db, $sourceRecordIdParts[0]); + $relatedRecordWsObject = VtigerWebserviceObject::fromId($db, $relatedRecordIdParts[0]); + + $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceRecordWsObject->getEntityName()); + $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedRecordWsObject->getEntityName()); + + $relationLabel = false; + $relationId = false; + if (is_numeric($relationIdLabel)) { + $relationId = $relationIdLabel; + } else if (!empty($relationIdLabel)) { + $relationLabel = $relationIdLabel; + } + + if ($sourceModuleModel && $relatedModuleModel) { + $relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel, $relationLabel, $relationId); + if ($relationModel) { + foreach ($relatedRecordId as $id) { + $idParts = vtws_getIdComponents($id); + if ($idParts[0] == $relatedRecordIdParts[0]) { + $relationModel->addRelation($sourceRecordIdParts[1], $idParts[1]); + } + } + } + } + return array('message' => 'successfull'); + } catch (Exception $ex) { + throw new Exception($ex->getMessage()); + } +} diff --git a/modules/Migration/schema/701_to_710.php b/modules/Migration/schema/701_to_710.php index 412e854af..8c51561f1 100644 --- a/modules/Migration/schema/701_to_710.php +++ b/modules/Migration/schema/701_to_710.php @@ -64,6 +64,21 @@ if (defined('VTIGER_UPGRADE')) { echo '<br>Succecssfully handled duplications<br>'; //END::Duplication Prevention + //START::Webform Attachements + if (!Vtiger_Utils::CheckTable('vtiger_webform_file_fields')) { + $db->pquery('CREATE TABLE IF NOT EXISTS vtiger_webform_file_fields(id INT(19) NOT NULL AUTO_INCREMENT, webformid INT(19) NOT NULL, fieldname VARCHAR(100) NOT NULL, fieldlabel VARCHAR(100) NOT NULL, required INT(1) NOT NULL DEFAULT 0, PRIMARY KEY (id), KEY fk_vtiger_webforms (webformid), CONSTRAINT fk_vtiger_webforms FOREIGN KEY (webformid) REFERENCES vtiger_webforms (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;', array()); + } + + $result = $db->pquery('SELECT 1 FROM vtiger_ws_operation WHERE name=?', array('add_related')); + if (!$db->num_rows($result)) { + $operationId = vtws_addWebserviceOperation('add_related', 'include/Webservices/AddRelated.php', 'vtws_add_related', 'POST'); + vtws_addWebserviceOperationParam($operationId, 'sourceRecordId', 'string', 1); + vtws_addWebserviceOperationParam($operationId, 'relatedRecordId', 'string', 2); + vtws_addWebserviceOperationParam($operationId, 'relationIdLabel', 'string', 3); + } + echo '<br>Succecssfully added Webforms attachements<br>'; + //END::Webform Attachements + //Update existing package modules Install_Utils_Model::installModules(); } \ No newline at end of file diff --git a/pkg/vtiger/modules/Webforms/languages/en_us/Settings/Webforms.php b/pkg/vtiger/modules/Webforms/languages/en_us/Settings/Webforms.php index 39b0fc7c5..72c65b48c 100644 --- a/pkg/vtiger/modules/Webforms/languages/en_us/Settings/Webforms.php +++ b/pkg/vtiger/modules/Webforms/languages/en_us/Settings/Webforms.php @@ -43,6 +43,12 @@ $languageStrings = array( 'LBL_ASSIGN_ROUND_ROBIN' => 'Assign Users In Round Robin', 'LBL_ROUNDROBIN_USERS_LIST' => 'Round Robin Users List', 'LBL_ADD_RECORD' => 'Add Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'Upload Documents', + 'LBL_ADD_FILE_FIELD' => 'File Upload Field', + 'LBL_FIELD_LABEL' => 'Document Title', + 'LBL_FILE_FIELD_INFO' => 'For each file uploaded from web form, a new Document is created with the attached file. Document is also linked to this newly created %s.', + 'LBL_NO_FILE_FIELD' => 'No file fields added.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copy to clipboard', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_REFERENCE_FIELDS_CANT_BE_MANDATORY_WITHOUT_OVERRIDE_VALUE' => 'Reference fields cant be mandatory without override value', 'JS_TYPE_TO_SEARCH' => 'Type to search', "JS_WEBFORM_WITH_THIS_NAME_ALREADY_EXISTS" => 'Webform with this name already exists', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximum you can add %s file fields.', + 'JS_COPIED_SUCCESSFULLY' => 'Copied successfully.', + 'JS_COPY_FAILED' => 'Copy failed. Please copy manually.', ); \ No newline at end of file diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsDetailView.tpl b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsDetailView.tpl index b7bfcbcdb..382b31c6f 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsDetailView.tpl +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsDetailView.tpl @@ -1,86 +1,121 @@ -{*<!-- -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 - * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source - * The Initial Developer of the Original Code is vtiger. - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. -* - ********************************************************************************/ --->*} +{*+********************************************************************************** +* The contents of this file are subject to the vtiger CRM Public License Version 1.1 +* ("License"); You may not use this file except in compliance with the License +* The Original Code is: vtiger CRM Open Source +* The Initial Developer of the Original Code is vtiger. +* Portions created by vtiger are Copyright (C) vtiger. +* All Rights Reserved. +*************************************************************************************} + {strip} -<div class="contents-topscroll"> -<div class="topscroll-div"> - -</div> -</div> -<div class="listViewEntriesDiv contents-bottomscroll"> - <div class="bottomscroll-div"> - <div class="fieldBlockContainer"> - <div class="fieldBlockHeader"> - <h4>{vtranslate($SOURCE_MODULE, {$SOURCE_MODULE})} {vtranslate('LBL_FIELD_INFORMATION', {$MODULE_NAME})}</h4> - </div> - <hr> - <table class="table table-bordered"> - <tr> - <td class="paddingLeft20"><b>{vtranslate('LBL_MANDATORY', {$MODULE_NAME})}</b></td> - <td><b>{vtranslate('LBL_HIDDEN', {$MODULE_NAME})}</b></td> - <td><b>{vtranslate('LBL_FIELD_NAME', {$MODULE_NAME})}</b></td> - <td><b>{vtranslate('LBL_OVERRIDE_VALUE', {$MODULE_NAME})}</b></td> - <td><b>{vtranslate('LBL_WEBFORM_REFERENCE_FIELD', {$MODULE_NAME})}</b></td> - </tr> - {foreach item=FIELD_MODEL key=FIELD_NAME from=$SELECTED_FIELD_MODELS_LIST} - {assign var=FIELD_STATUS value="{$FIELD_MODEL->get('required')}"} - {assign var=FIELD_HIDDEN_STATUS value="{$FIELD_MODEL->get('hidden')}"} - <tr> - <td class="paddingLeft20"> - {if ($FIELD_STATUS eq 1) or ($FIELD_MODEL->isMandatory(true))} - {assign var=FIELD_VALUE value="LBL_YES"} - {else} - {assign var=FIELD_VALUE value="LBL_NO"} - {/if} - {vtranslate({$FIELD_VALUE}, {$SOURCE_MODULE})} - </td> - <td> - {if $FIELD_HIDDEN_STATUS eq 1} - {assign var=FIELD_VALUE value="LBL_YES"} - {else} - {assign var=FIELD_VALUE value="LBL_NO"} - {/if} - {vtranslate({$FIELD_VALUE}, {$SOURCE_MODULE})} - </td> - <td> - {vtranslate($FIELD_MODEL->get('label'), {$SOURCE_MODULE})} - {if $FIELD_MODEL->isMandatory()} - <span class="redColor">*</span> - {/if} - </td> - <td> - {if $FIELD_MODEL->getFieldDataType() eq 'reference'} - {assign var=EXPLODED_FIELD_VALUE value = 'x'|explode:$FIELD_MODEL->get('defaultvalue')} - {assign var=FIELD_VALUE value=$EXPLODED_FIELD_VALUE[1]} - {if !isRecordExists($FIELD_VALUE)} - {assign var=FIELD_VALUE value=0} - {/if} - {else} - {assign var=FIELD_VALUE value=$FIELD_MODEL->get('defaultvalue')} - {/if} - {$FIELD_MODEL->getDisplayValue($FIELD_VALUE, $RECORD->getId(), $RECORD)} - </td> - <td> - {if Settings_Webforms_Record_Model::isCustomField($FIELD_MODEL->get('name'))} - {vtranslate('LBL_LABEL', $MODULE_NAME)} : {vtranslate($FIELD_MODEL->get('label'), $MODULE_NAME)} - {else} - {vtranslate({$FIELD_MODEL->get('neutralizedfield')}, $SOURCE_MODULE)} - {/if} - </td> - </tr> - {/foreach} - </tbody> - </table> + <div class="contents-topscroll"> + <div class="topscroll-div"> + + </div> + </div> + <div class="listViewEntriesDiv contents-bottomscroll"> + <div class="bottomscroll-div"> + <div class="fieldBlockContainer"> + <div class="fieldBlockHeader"> + <h4>{vtranslate($SOURCE_MODULE, {$SOURCE_MODULE})} {vtranslate('LBL_FIELD_INFORMATION', {$MODULE_NAME})}</h4> + </div> + <hr> + <table class="table table-bordered"> + <tr> + <td class="paddingLeft20"><b>{vtranslate('LBL_MANDATORY', {$MODULE_NAME})}</b></td> + <td><b>{vtranslate('LBL_HIDDEN', {$MODULE_NAME})}</b></td> + <td><b>{vtranslate('LBL_FIELD_NAME', {$MODULE_NAME})}</b></td> + <td><b>{vtranslate('LBL_OVERRIDE_VALUE', {$MODULE_NAME})}</b></td> + <td><b>{vtranslate('LBL_WEBFORM_REFERENCE_FIELD', {$MODULE_NAME})}</b></td> + </tr> + {foreach item=FIELD_MODEL key=FIELD_NAME from=$SELECTED_FIELD_MODELS_LIST} + {assign var=FIELD_STATUS value="{$FIELD_MODEL->get('required')}"} + {assign var=FIELD_HIDDEN_STATUS value="{$FIELD_MODEL->get('hidden')}"} + <tr> + <td class="paddingLeft20"> + {if ($FIELD_STATUS eq 1) or ($FIELD_MODEL->isMandatory(true))} + {assign var=FIELD_VALUE value="LBL_YES"} + {else} + {assign var=FIELD_VALUE value="LBL_NO"} + {/if} + {vtranslate({$FIELD_VALUE}, {$SOURCE_MODULE})} + </td> + <td> + {if $FIELD_HIDDEN_STATUS eq 1} + {assign var=FIELD_VALUE value="LBL_YES"} + {else} + {assign var=FIELD_VALUE value="LBL_NO"} + {/if} + {vtranslate({$FIELD_VALUE}, {$SOURCE_MODULE})} + </td> + <td> + {vtranslate($FIELD_MODEL->get('label'), {$SOURCE_MODULE})} + {if $FIELD_MODEL->isMandatory()} + <span class="redColor">*</span> + {/if} + </td> + <td> + {if $FIELD_MODEL->getFieldDataType() eq 'reference'} + {assign var=EXPLODED_FIELD_VALUE value = 'x'|explode:$FIELD_MODEL->get('defaultvalue')} + {assign var=FIELD_VALUE value=$EXPLODED_FIELD_VALUE[1]} + {if !isRecordExists($FIELD_VALUE)} + {assign var=FIELD_VALUE value=0} + {/if} + {else} + {assign var=FIELD_VALUE value=$FIELD_MODEL->get('defaultvalue')} + {/if} + {$FIELD_MODEL->getDisplayValue($FIELD_VALUE, $RECORD->getId(), $RECORD)} + </td> + <td> + {if Settings_Webforms_Record_Model::isCustomField($FIELD_MODEL->get('name'))} + {vtranslate('LBL_LABEL', $MODULE_NAME)} : {vtranslate($FIELD_MODEL->get('label'), $MODULE_NAME)} + {else} + {vtranslate({$FIELD_MODEL->get('neutralizedfield')}, $SOURCE_MODULE)} + {/if} + </td> + </tr> + {/foreach} + </tbody> + </table> + </div> + </div> </div> - </div> + {if Vtiger_Functions::isDocumentsRelated($SOURCE_MODULE) && count($DOCUMENT_FILE_FIELDS)} + <div class="listViewEntriesDiv contents-bottomscroll"> + <div class="bottomscroll-div"> + <div class="fieldBlockContainer"> + <div class="fieldBlockHeader"> + <h4>{vtranslate('LBL_UPLOAD_DOCUMENTS', $MODULE_NAME)}</h4> + </div> + <div> + <div class="col-lg-7 padding0"> + <table class="table table-bordered"> + <tr> + <td><b>{vtranslate('LBL_FIELD_LABEL', $MODULE_NAME)}</b></td> + <td><b>{vtranslate('LBL_MANDATORY', $MODULE_NAME)}</b></td> + </tr> + {foreach from=$DOCUMENT_FILE_FIELDS item=DOCUMENT_FILE_FIELD} + <tr> + <td>{$DOCUMENT_FILE_FIELD['fieldlabel']}</td> + <td>{if $DOCUMENT_FILE_FIELD['required']}{vtranslate('LBL_YES')}{else}{vtranslate('LBL_NO')}{/if}</td> + </tr> + {/foreach} + </table> + </div> + <div class="col-lg-5"> + <div class="vt-default-callout vt-info-callout" style="margin: 0;"> + <h4 class="vt-callout-header"> + <span class="fa fa-info-circle"></span> {vtranslate('LBL_INFO')} + </h4> + <div> + {vtranslate('LBL_FILE_FIELD_INFO', $QUALIFIED_MODULE, vtranslate("SINGLE_$SOURCE_MODULE", $SOURCE_MODULE))} + </div> + </div> + </div> + </div> + </div> + </div> + </div> + {/if} </div> - </div> {/strip} \ No newline at end of file diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsEditView.tpl b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsEditView.tpl index 7e1150158..eb984f467 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsEditView.tpl +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/FieldsEditView.tpl @@ -126,4 +126,62 @@ </tbody> </table> </div> + {if Vtiger_Functions::isDocumentsRelated($SOURCE_MODULE)} + <div class="fieldBlockContainer"> + <div class="fieldBlockHeader"> + <h4>{vtranslate('LBL_UPLOAD_DOCUMENTS', $QUALIFIED_MODULE)}</h4> + </div> + <hr> + <div> + <div> + <button class="btn btn-default" id="addFileFieldBtn"> + <span class="fa fa-plus"></span> {vtranslate('LBL_ADD_FILE_FIELD', $QUALIFIED_MODULE)} + </button> + </div> + </div> + <div class="row" style="margin-top: 10px;"> + <div class="col-lg-7"> + <table class="table table-bordered" id='fileFieldsTable'> + <tbody> + <tr> + <td><b>{vtranslate('LBL_FIELD_LABEL', $QUALIFIED_MODULE)}</b></td> + <td class="textAlignCenter"><b>{vtranslate('LBL_MANDATORY', $QUALIFIED_MODULE)}</b></td> + <td class="textAlignCenter"><b>{vtranslate('LBL_ACTIONS', $QUALIFIED_MODULE)}</b></td> + </tr> + {foreach from=$DOCUMENT_FILE_FIELDS key=FILE_INDEX item=DOCUMENT_FILE_FIELD} + <tr> + <td style="vertical-align: middle;"> + <input type="text" class="inputElement nameField" name="file_field[{$FILE_INDEX}][fieldlabel]" value="{$DOCUMENT_FILE_FIELD['fieldlabel']}" data-rule-required="true"> + </td> + <td class="textAlignCenter" style="vertical-align: middle;"> + <input type="checkbox" name="file_field[{$FILE_INDEX}][required]" {if $DOCUMENT_FILE_FIELD['required']}checked='checked'{/if} value='1'> + </td> + <td class="textAlignCenter" style="vertical-align: middle;"> + <a class="removeFileField" style="color: black;"><i class="fa fa-trash icon-trash"></i></a> + </td> + </tr> + {/foreach} + <tr class="noFileField {if count($DOCUMENT_FILE_FIELDS) gt 0}hide{/if}"> + <td colspan="3" style="height: 100px; vertical-align: middle;"> + <center>{vtranslate('LBL_NO_FILE_FIELD', $QUALIFIED_MODULE)}</center> + </td> + </tr> + </tbody> + </table> + </div> + <div class="col-lg-5"> + <div class="vt-default-callout vt-info-callout" style="margin: 0;"> + <h4 class="vt-callout-header"> + <span class="fa fa-info-circle"></span> {vtranslate('LBL_INFO')} + </h4> + <div> + {vtranslate('LBL_FILE_FIELD_INFO', $QUALIFIED_MODULE, vtranslate("SINGLE_$SOURCE_MODULE", $SOURCE_MODULE))} + </div> + </div> + </div> + </div> + <input type="hidden" id='fileFieldNextIndex' value='{count($DOCUMENT_FILE_FIELDS) + 1}'> + <input type="hidden" id="fileFieldsCount" value="{count($DOCUMENT_FILE_FIELDS)}"> + </div> + {/if} {/strip} diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/ShowForm.tpl b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/ShowForm.tpl index dd1e90a4b..ce8b18076 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/ShowForm.tpl +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/ShowForm.tpl @@ -1,125 +1,137 @@ -{*<!-- -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 +{*+********************************************************************************** +* The contents of this file are subject to the vtiger CRM Public License Version 1.1 * ("License"); You may not use this file except in compliance with the License -* The Original Code is: vtiger CRM Open Source +* The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. -* -********************************************************************************/ --->*} -<div class="modal-dialog modelContainer modal-content"> - {assign var=HEADER_TITLE value={vtranslate('SINGLE_'|cat:$MODULE, $QUALIFIED_MODULE)}|cat:" - "|cat:{$RECORD_MODEL->get('name')}} - {include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE=$HEADER_TITLE} +*************************************************************************************} - <div class='modal-body'> - <div class="marginBottom10px">{vtranslate('LBL_EMBED_THE_FOLLOWING_FORM_IN_YOUR_WEBSITE', $QUALIFIED_MODULE)}</div> +{strip} + <div class="modal-dialog modelContainer modal-content"> + {assign var=HEADER_TITLE value={vtranslate('SINGLE_'|cat:$MODULE, $QUALIFIED_MODULE)}|cat:" - "|cat:{$RECORD_MODEL->get('name')}} + {include file="ModalHeader.tpl"|vtemplate_path:$MODULE TITLE=$HEADER_TITLE} - <textarea id="showFormContent" class="input-xxlarge" style="min-height:400px;width: 100%" readonly></textarea> + <div class="modal-body"> + <div class="marginBottom10px"> + <span>{vtranslate('LBL_EMBED_THE_FOLLOWING_FORM_IN_YOUR_WEBSITE', $QUALIFIED_MODULE)}</span> + <span class="pull-right"> + <a href="" id="webformCopyClipboard"> + <i class="fa fa-clipboard" aria-hidden="true"></i> + {vtranslate('LBL_COPY_TO_CLIPBOARD', $QUALIFIED_MODULE)} + </a> + </span> + </div> + <input type="hidden" class="allowedAllFilesSize" value="{$ALLOWED_ALL_FILES_SIZE}"> + <textarea id="showFormContent" class="input-xxlarge" style="min-height:400px;width: 100%" readonly></textarea> -<code> -<pre> - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> - <form id="__vtigerWebForm" name="{$RECORD_MODEL->getName()}" action="{$ACTION_PATH}" - method="post" accept-charset="utf-8" enctype="multipart/form-data"> - <input type="hidden" name="publicid" value="{$RECORD_MODEL->get('publicid')}" /> - <input type="hidden" name="urlencodeenable" value="1" /> - <input type="hidden" name="name" value="{$RECORD_MODEL->getName()}" /> - {assign var=IS_CAPTCHA_ENABLED value=$RECORD_MODEL->isCaptchaEnabled()} - <table> - {foreach item=FIELD_MODEL key=FIELD_NAME from=$SELECTED_FIELD_MODELS_LIST} - {assign var=SOURCE_MODULE value=$FIELD_MODEL->getModuleName()} - {assign var=DATA_TYPE value=$FIELD_MODEL->getFieldDataType()} - {assign var=HIDDEN_STATUS value=$FIELD_MODEL->get('hidden')} - {assign var=TYPE value=""} - <tr> + <code> + <pre> + <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> + <form id="__vtigerWebForm" name="{$RECORD_MODEL->getName()}" action="{$ACTION_PATH}" method="post" accept-charset="utf-8" enctype="multipart/form-data"> + <input type="hidden" name="publicid" value="{$RECORD_MODEL->get('publicid')}" /> + <input type="hidden" name="urlencodeenable" value="1" /> + <input type="hidden" name="name" value="{$RECORD_MODEL->getName()}" /> + {assign var=IS_CAPTCHA_ENABLED value=$RECORD_MODEL->isCaptchaEnabled()} + <table> + {foreach item=FIELD_MODEL key=FIELD_NAME from=$SELECTED_FIELD_MODELS_LIST} + {assign var=SOURCE_MODULE value=$FIELD_MODEL->getModuleName()} + {assign var=DATA_TYPE value=$FIELD_MODEL->getFieldDataType()} + {assign var=HIDDEN_STATUS value=$FIELD_MODEL->get('hidden')} + {assign var=TYPE value=""} + <tr> - {if $FIELD_MODEL->get('hidden') neq 1}<td><label>{vtranslate(decode_html($FIELD_MODEL->get('label')), {$SOURCE_MODULE})}{if $FIELD_MODEL->get('required') eq 1}*{/if}</label></td>{/if} - <td> - {if ($DATA_TYPE eq 'picklist' || $DATA_TYPE eq 'multipicklist')} - {assign var=FIELD_INFO value=$FIELD_MODEL->getFieldInfo()} - {assign var=PICKLIST_VALUES value=$FIELD_INFO['picklistvalues']} - {assign var=FIELD_INFO value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($FIELD_INFO))} - {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} - {assign var=PICKLIST_NAME value=$FIELD_MODEL->get('name')} - {if Settings_Webforms_Record_Model::isCustomField($FIELD_NAME)} - {assign var=FIELD_LABEL value="{urlencode($FIELD_MODEL->get('label'))}"} - {assign var=PICKLIST_DATA_LABEL value="label:{$FIELD_LABEL|replace:' ':'_'}"} - {else} - {assign var=PICKLIST_DATA_LABEL value=$FIELD_MODEL->get('name')} - {/if} - {else if ($DATA_TYPE eq "salutation") or ($DATA_TYPE eq "string") or ($DATA_TYPE eq "time") or ($DATA_TYPE eq "currency") or ($DATA_TYPE eq "url") or ($DATA_TYPE eq "phone")} - {assign var=TYPE value="text"} - {else if ($DATA_TYPE eq "text")} - {assign var=TYPE value="text"} - <textarea name="{urlencode($FIELD_MODEL->getFieldName())}" {if $FIELD_MODEL->get('required') eq 1} required{/if} - {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if} >{$FIELD_MODEL->get('fieldvalue')}</textarea> - {else if ($DATA_TYPE eq "email")} - {assign var=TYPE value="email"} - {else if ($DATA_TYPE eq "image")} - {assign var=TYPE value="image"} - {else if (($DATA_TYPE eq "integer") or ($DATA_TYPE eq "double"))} - {assign var=TYPE value="number"} - {else if ($DATA_TYPE eq "boolean")} - {assign var=TYPE value="checkbox"} - {else if ($DATA_TYPE eq "date")} - {assign var=TYPE value="date"} - {/if} - {if $HIDDEN_STATUS eq 1} - {assign var=TYPE value=hidden} - {/if} - {if $DATA_TYPE eq 'picklist'} - <select name="{$PICKLIST_NAME}" data-label="{$PICKLIST_DATA_LABEL}" {if $FIELD_MODEL->get('required') eq 1} required{/if} - {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if}> - <option value>{vtranslate('LBL_SELECT_VALUE',$QUALIFIED_MODULE)}</option> - {foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES} - <option value="{$PICKLIST_NAME}" {if trim(decode_html($FIELD_MODEL->get('fieldvalue'))) eq trim($PICKLIST_NAME)} selected {/if}>{$PICKLIST_VALUE}</option> - {/foreach} - </select> + {if $FIELD_MODEL->get('hidden') neq 1}<td><label>{vtranslate(decode_html($FIELD_MODEL->get('label')), {$SOURCE_MODULE})}{if $FIELD_MODEL->get('required') eq 1}*{/if}</label></td>{/if} + <td> + {if ($DATA_TYPE eq 'picklist' || $DATA_TYPE eq 'multipicklist')} + {assign var=FIELD_INFO value=$FIELD_MODEL->getFieldInfo()} + {assign var=PICKLIST_VALUES value=$FIELD_INFO['picklistvalues']} + {assign var=FIELD_INFO value=Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($FIELD_INFO))} + {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} + {assign var=PICKLIST_NAME value=$FIELD_MODEL->get('name')} + {if Settings_Webforms_Record_Model::isCustomField($FIELD_NAME)} + {assign var=FIELD_LABEL value="{urlencode($FIELD_MODEL->get('label'))}"} + {assign var=PICKLIST_DATA_LABEL value="label:{$FIELD_LABEL|replace:' ':'_'}"} + {else} + {assign var=PICKLIST_DATA_LABEL value=$FIELD_MODEL->get('name')} + {/if} + {else if ($DATA_TYPE eq "salutation") or ($DATA_TYPE eq "string") or ($DATA_TYPE eq "time") or ($DATA_TYPE eq "currency") or ($DATA_TYPE eq "url") or ($DATA_TYPE eq "phone")} + {assign var=TYPE value="text"} + {else if ($DATA_TYPE eq "text")} + {assign var=TYPE value="text"} + <textarea name="{urlencode($FIELD_MODEL->getFieldName())}" {if $FIELD_MODEL->get('required') eq 1} required{/if} + {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if} >{$FIELD_MODEL->get('fieldvalue')}</textarea> + {else if ($DATA_TYPE eq "email")} + {assign var=TYPE value="email"} + {else if ($DATA_TYPE eq "image")} + {assign var=TYPE value="image"} + {else if (($DATA_TYPE eq "integer") or ($DATA_TYPE eq "double"))} + {assign var=TYPE value="number"} + {else if ($DATA_TYPE eq "boolean")} + {assign var=TYPE value="checkbox"} + {else if ($DATA_TYPE eq "date")} + {assign var=TYPE value="date"} + {/if} + {if $HIDDEN_STATUS eq 1} + {assign var=TYPE value=hidden} + {/if} + {if $DATA_TYPE eq 'picklist'} + <select name="{$PICKLIST_NAME}" data-label="{$PICKLIST_DATA_LABEL}" {if $FIELD_MODEL->get('required') eq 1} required{/if} {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if}> + <option value>{vtranslate('LBL_SELECT_VALUE',$QUALIFIED_MODULE)}</option> + {foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES} + <option value="{$PICKLIST_NAME}" {if trim(decode_html($FIELD_MODEL->get('fieldvalue'))) eq trim($PICKLIST_NAME)} selected {/if}>{$PICKLIST_VALUE}</option> + {/foreach} + </select> - {else if $DATA_TYPE eq 'multipicklist'} - {assign var="FIELD_VALUE_LIST" value=explode(' |##| ',$FIELD_MODEL->get('fieldvalue'))} - <select name="{$PICKLIST_NAME}[]" data-label="{$PICKLIST_DATA_LABEL}" {if $FIELD_MODEL->get('required') eq 1} required{/if} multiple style="width: 60%;" - {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if}> - {foreach item=PICKLIST_VALUE from=$PICKLIST_VALUES} - <option value="{$PICKLIST_VALUE}" {if in_array(Vtiger_Util_Helper::toSafeHTML($PICKLIST_VALUE), $FIELD_VALUE_LIST)} selected {/if}>{vtranslate($PICKLIST_VALUE, $MODULE)}</option> - {/foreach} - </select> - {elseif $DATA_TYPE eq "reference"} - <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value="{$FIELD_MODEL->get('fieldvalue')}" /> - {assign var=EXPLODED_FIELD_VALUES value='x'|explode:$FIELD_MODEL->get('fieldvalue')} - <input type="{$TYPE}" value="{$FIELD_MODEL->getEditViewDisplayValue($EXPLODED_FIELD_VALUES[1])}" readonly= /> - {elseif $DATA_TYPE eq "image"} - <input type="file" name="{urlencode($FIELD_MODEL->getFieldName())}[]" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if} {if $FIELD_MODEL->get('required') eq 1} required{/if}/> - {else if $DATA_TYPE eq "boolean"} - <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=0 /> - {if ($HIDDEN_STATUS eq 1) and ($FIELD_MODEL->get('fieldvalue') eq "on")} - <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=1 checked /> - {elseif ($HIDDEN_STATUS neq 1)} - <input type="{$TYPE}" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=1 {if $FIELD_MODEL->get('fieldvalue') eq "on"} checked {/if} {if ($FIELD_MODEL->get('required') eq 1) || ($FIELD_MODEL->isMandatory(true))} required{/if}/> - {/if} - {elseif ($DATA_TYPE neq "text") and ($DATA_TYPE neq "boolean")} - <input type="{$TYPE}" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value="{$FIELD_MODEL->get('fieldvalue')}" {if ($FIELD_MODEL->get('required') eq 1) || ($FIELD_MODEL->isMandatory(true))} required{/if} {if ($DATA_TYPE eq "double")} datatype="{$DATA_TYPE}" step="any" {/if} - />{if ($DATA_TYPE eq "date") and ($FIELD_MODEL->get('hidden') neq 1)}(yyyy-mm-dd){/if} - {/if} - </td></tr> - {/foreach} - </table> - {if $IS_CAPTCHA_ENABLED} - <div id="captchaField"></div> - <input type="hidden" id="captchaUrl" value="{$CAPTCHA_PATH}"> - <input type="hidden" id="recaptcha_validation_value" > - {/if} - <input type="submit" value="Submit" ></input> - </form> - </pre> - </code> - <input type="hidden" name="isCaptchaEnabled" value="{$IS_CAPTCHA_ENABLED}"> - </div> - <div class="modal-footer"> - <center> - <a href="#" class="cancelLink" type="reset" data-dismiss="modal">{vtranslate('LBL_CANCEL', $MODULE)}</a> - </center> - </div> - </div> + {else if $DATA_TYPE eq 'multipicklist'} + {assign var="FIELD_VALUE_LIST" value=explode(' |##| ',$FIELD_MODEL->get('fieldvalue'))} + <select name="{$PICKLIST_NAME}[]" data-label="{$PICKLIST_DATA_LABEL}" {if $FIELD_MODEL->get('required') eq 1} required{/if} multiple style="width: 60%;" {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if}> + {foreach item=PICKLIST_VALUE from=$PICKLIST_VALUES} + <option value="{$PICKLIST_VALUE}" {if in_array(Vtiger_Util_Helper::toSafeHTML($PICKLIST_VALUE), $FIELD_VALUE_LIST)} selected {/if}>{vtranslate($PICKLIST_VALUE, $MODULE)}</option> + {/foreach} + </select> + {elseif $DATA_TYPE eq "reference"} + <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value="{$FIELD_MODEL->get('fieldvalue')}" /> + {assign var=EXPLODED_FIELD_VALUES value='x'|explode:$FIELD_MODEL->get('fieldvalue')} + <input type="{$TYPE}" value="{$FIELD_MODEL->getEditViewDisplayValue($EXPLODED_FIELD_VALUES[1])}" readonly= /> + {elseif $DATA_TYPE eq "image"} + <input type="file" name="{urlencode($FIELD_MODEL->getFieldName())}[]" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" {if $FIELD_MODEL->get('hidden') eq 1} hidden{/if} {if $FIELD_MODEL->get('required') eq 1} required{/if}/> + {else if $DATA_TYPE eq "boolean"} + <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=0 /> + {if ($HIDDEN_STATUS eq 1) and ($FIELD_MODEL->get('fieldvalue') eq "on")} + <input type="hidden" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=1 checked /> + {elseif ($HIDDEN_STATUS neq 1)} + <input type="{$TYPE}" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value=1 {if $FIELD_MODEL->get('fieldvalue') eq "on"} checked {/if} {if ($FIELD_MODEL->get('required') eq 1) || ($FIELD_MODEL->isMandatory(true))} required{/if}/> + {/if} + {elseif ($DATA_TYPE neq "text") and ($DATA_TYPE neq "boolean")} + <input type="{$TYPE}" name="{urlencode($FIELD_MODEL->getFieldName())}" data-label="{$FIELD_MODEL->get('neutralizedFieldName')}" value="{$FIELD_MODEL->get('fieldvalue')}" {if ($FIELD_MODEL->get('required') eq 1) || ($FIELD_MODEL->isMandatory(true))} required{/if} {if ($DATA_TYPE eq "double")} datatype="{$DATA_TYPE}" step="any" {/if}/> + {if ($DATA_TYPE eq "date") and ($FIELD_MODEL->get('hidden') neq 1)}(yyyy-mm-dd){/if} + {/if} + </td> + </tr> + {/foreach} + {foreach from=$DOCUMENT_FILE_FIELDS item=DOCUMENT_FILE_FIELD} + <tr> + <td><label>{$DOCUMENT_FILE_FIELD['fieldlabel']} {if $DOCUMENT_FILE_FIELD['required']}*{/if}</label></td> + <td><input type="file" name="{$DOCUMENT_FILE_FIELD['fieldname']}" {if $DOCUMENT_FILE_FIELD['required']}required='required'{/if}></td> + </tr> + {/foreach} + </table> + {if $IS_CAPTCHA_ENABLED} + <div id="captchaField"></div> + <input type="hidden" id="captchaUrl" value="{$CAPTCHA_PATH}"> + <input type="hidden" id="recaptcha_validation_value" > + {/if} + <input type="submit" value="Submit" ></input> + </form> + </pre> + </code> + <input type="hidden" name="isCaptchaEnabled" value="{$IS_CAPTCHA_ENABLED}"> + </div> + <div class="modal-footer"> + <center> + <a href="#" class="cancelLink" type="reset" data-dismiss="modal">{vtranslate('LBL_CANCEL', $MODULE)}</a> + </center> + </div> + </div> +{/strip} diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Detail.js b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Detail.js index e1b73aab3..b44e0d9c5 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Detail.js +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Detail.js @@ -35,6 +35,7 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', { * @params: show webform record url */ showForm : function(record){ + var self = this; var params = { 'module' : 'Webforms', 'record' : record, @@ -45,6 +46,7 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', { function(error, data){ var callback = function(container){ //show html without rendering + var allowedAllFilesSize = container.find('.allowedAllFilesSize').val(); var showFormContents = container.find('pre').html(); showFormContents = showFormContents + '<script type="text/javascript">'+ 'window.onload = function() { '+ @@ -108,7 +110,21 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', { 'var dateRegex = /^[1-9][0-9]{3}-(0[1-9]|1[0-2]|[1-9]{1})-(0[1-9]|[1-2][0-9]|3[0-1]|[1-9]{1})$/;' + 'if(!dateRegex.test(dateVal)) {' + 'alert("For "+ elemLabel +" field please enter valid date in required format"); return false;' + - '}}}'; + '}}}'+ + 'var inputElems = document.getElementsByTagName("input");'+ + 'var totalFileSize = 0;'+ + 'for(var i = 0; i < inputElems.length; i++) {'+ + 'if(inputElems[i].type.toLowerCase() === "file") {'+ + 'var file = inputElems[i].files[0];'+ + 'if(typeof file !== "undefined") {'+ + 'var totalFileSize = totalFileSize + file.size;'+ + '}'+ + '}'+ + '}'+ + 'if(totalFileSize > '+allowedAllFilesSize+') {'+ + 'alert("Maximum allowed file size including all files is 50MB.");'+ + 'return false;'+ + '}'; if(container.find('[name=isCaptchaEnabled]').val() == true) { showFormContents = Settings_Webforms_Detail_Js.getCaptchaCode(showFormContents); } else { @@ -122,6 +138,7 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', { //Rendering content has been removed from container container.find('pre').remove(); container.find('code').remove(); + self.registerCopyToClipboard(); }; app.helper.showModal(data, { @@ -130,6 +147,32 @@ Settings_Vtiger_Detail_Js('Settings_Webforms_Detail_Js', { } ) }, + + registerCopyToClipboard: function () { + jQuery('#webformCopyClipboard').click(function (e) { + e.preventDefault(); + try { + document.getElementById('showFormContent').select(); + var success = document.execCommand("copy"); + if (success) { + app.helper.showSuccessNotification({message: app.vtranslate('JS_COPIED_SUCCESSFULLY')}); + } else { + app.helper.showErrorNotification({message: app.vtranslate('JS_COPY_FAILED')}); + } + if (window.getSelection) { + if (window.getSelection().empty) { + window.getSelection().empty(); + } else if (window.getSelection().removeAllRanges) { + window.getSelection().removeAllRanges(); + } + } else if (document.selection) { + document.selection.empty(); + } + } catch (err) { + app.helper.showErrorNotification({message: app.vtranslate('JS_COPY_FAILED')}); + } + }); + }, /** * Function get Captcha Code diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Edit.js b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Edit.js index 31f461b92..8c2c5c2d2 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Edit.js +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/Edit.js @@ -315,6 +315,61 @@ Settings_Vtiger_Edit_Js('Settings_Webforms_Edit_Js', {}, { this.arrangeSelectedChoicesInOrder(); this.registerEventToHandleOnChangeOfOverrideValue(); this.registerAutoCompleteFields(editViewForm); + //Document file fields handling + this.registerAddFileFieldEvent(editViewForm); + this.registerFileFieldRemoveEvent(editViewForm); + }, + + fileFieldsLimit: 5, + /** + * Function to handle add file field click event + * @param form - Edit view form. + */ + registerAddFileFieldEvent: function (form) { + var self = this; + var container = jQuery(form); + container.find('#addFileFieldBtn').click(function (e) { + e.preventDefault(); + var fileFieldsCount = parseInt(jQuery('#fileFieldsCount').val()); + if (fileFieldsCount >= self.fileFieldsLimit) { + app.helper.showAlertNotification({message: app.vtranslate('JS_MAX_FILE_FIELDS_LIMIT', self.fileFieldsLimit)}); + return false; + } + var fieldIndex = jQuery('#fileFieldNextIndex').val(); + var html = '<tr>\n\ + <td style="vertical-align: middle;">\n\ + <input type="text" class="inputElement nameField" name="file_field['+fieldIndex+'][fieldlabel]" data-rule-required="true">\n\ + </td>\n\ + <td class="textAlignCenter" style="vertical-align: middle;">\n\ + <input type="checkbox" name="file_field['+fieldIndex+'][required]" value="1">\n\ + </td>\n\ + <td class="textAlignCenter" style="vertical-align: middle;">\n\ + <a class="removeFileField" style="color: black;"><i class="fa fa-trash icon-trash"></i></a>\n\ + </td>\n\ + </tr>'; + container.find('table#fileFieldsTable').find('tbody').append(html); + jQuery('#fileFieldNextIndex').val(parseInt(fieldIndex)+1); + jQuery('#fileFieldsCount').val(fileFieldsCount+1); + container.find('.noFileField').addClass('hide'); + self.registerFileFieldRemoveEvent(form); + }); + }, + /** + * Function to handle remove file field click event + * @param container - Edit view form. + */ + registerFileFieldRemoveEvent: function (container) { + container = jQuery(container); + container.find('.removeFileField').off('click'); + container.find('.removeFileField').on('click', function (e) { + e.preventDefault(); + var fileFieldsCount = parseInt(jQuery('#fileFieldsCount').val()); + jQuery(e.currentTarget).closest('tr').remove(); + jQuery('#fileFieldsCount').val(fileFieldsCount-1); + if (container.find('#fileFieldsTable').find('tr:visible').length == 1) { + container.find('.noFileField').removeClass('hide'); + } + }); }, /** diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/List.js b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/List.js index 465522760..f9e306e44 100644 --- a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/List.js +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/resources/List.js @@ -14,6 +14,7 @@ Settings_Vtiger_List_Js("Settings_Webforms_List_Js",{ * @params: show form url */ showForm : function(event,record){ + var self = this; event.stopPropagation(); var params = { 'module' : 'Webforms', @@ -24,6 +25,7 @@ Settings_Vtiger_List_Js("Settings_Webforms_List_Js",{ app.request.post({'data':params}).then( function(e,data){ var callback = function(container){ + var allowedAllFilesSize = container.find('.allowedAllFilesSize').val(); var showFormContents = container.find('pre').html(); showFormContents = showFormContents + '<script type="text/javascript">'+ 'window.onload = function() { '+ @@ -82,7 +84,21 @@ Settings_Vtiger_List_Js("Settings_Webforms_List_Js",{ 'var dateRegex = /^[1-9][0-9]{3}-(0[1-9]|1[0-2]|[1-9]{1})-(0[1-9]|[1-2][0-9]|3[0-1]|[1-9]{1})$/;' + 'if(!dateRegex.test(dateVal)) {' + 'alert("For "+ elemLabel +" field please enter valid date in required format"); return false;' + - '}}}'; + '}}}'+ + 'var inputElems = document.getElementsByTagName("input");'+ + 'var totalFileSize = 0;'+ + 'for(var i = 0; i < inputElems.length; i++) {'+ + 'if(inputElems[i].type.toLowerCase() === "file") {'+ + 'var file = inputElems[i].files[0];'+ + 'if(typeof file !== "undefined") {'+ + 'var totalFileSize = totalFileSize + file.size;'+ + '}'+ + '}'+ + '}'+ + 'if(totalFileSize > '+allowedAllFilesSize+') {'+ + 'alert("Maximum allowed file size including all files is 50MB.");'+ + 'return false;'+ + '}'; if(container.find('[name=isCaptchaEnabled]').val() == true) { showFormContents = Settings_Webforms_List_Js.getCaptchaCode(showFormContents); } else { @@ -94,6 +110,7 @@ Settings_Vtiger_List_Js("Settings_Webforms_List_Js",{ container.find('#showFormContent').text(showFormContents); container.find('pre').remove(); container.find('code').remove(); + self.registerCopyToClipboard(); } app.helper.showModal(data,{'cb':callback}); }, @@ -101,7 +118,33 @@ Settings_Vtiger_List_Js("Settings_Webforms_List_Js",{ } ) }, - + + registerCopyToClipboard: function () { + jQuery('#webformCopyClipboard').click(function (e) { + e.preventDefault(); + try { + document.getElementById('showFormContent').select(); + var success = document.execCommand("copy"); + if (success) { + app.helper.showSuccessNotification({message: app.vtranslate('JS_COPIED_SUCCESSFULLY')}); + } else { + app.helper.showErrorNotification({message: app.vtranslate('JS_COPY_FAILED')}); + } + if (window.getSelection) { + if (window.getSelection().empty) { + window.getSelection().empty(); + } else if (window.getSelection().removeAllRanges) { + window.getSelection().removeAllRanges(); + } + } else if (document.selection) { + document.selection.empty(); + } + } catch (err) { + app.helper.showErrorNotification({message: app.vtranslate('JS_COPY_FAILED')}); + } + }); + }, + /** * Function get Captcha Code * @param <string> showFormContents diff --git a/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/uitypes/Picklist.tpl b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/uitypes/Picklist.tpl new file mode 100644 index 000000000..9247db6c0 --- /dev/null +++ b/pkg/vtiger/modules/Webforms/layouts/v7/modules/Settings/Webforms/uitypes/Picklist.tpl @@ -0,0 +1,38 @@ +{*+********************************************************************************** +* The contents of this file are subject to the vtiger CRM Public License Version 1.1 +* ("License"); You may not use this file except in compliance with the License +* The Original Code is: vtiger CRM Open Source +* The Initial Developer of the Original Code is vtiger. +* Portions created by vtiger are Copyright (C) vtiger. +* All Rights Reserved. +*************************************************************************************} + +{strip} + {assign var="FIELD_INFO" value=$FIELD_MODEL->getFieldInfo()} + {assign var="PICKLIST_VALUES" value=$FIELD_INFO['picklistvalues']} + {assign var=PICKLIST_COLORS value=$FIELD_INFO['picklistColors']} + {assign var="SPECIAL_VALIDATOR" value=$FIELD_MODEL->getValidator()} + <select data-fieldname="{$FIELD_MODEL->getFieldName()}" data-fieldtype="picklist" class="inputElement select2 {if $OCCUPY_COMPLETE_WIDTH} row {/if}" type="picklist" data-field-id= '{$FIELD_MODEL->get('id')}' name="{$FIELD_MODEL->getFieldName()}" {if !empty($SPECIAL_VALIDATOR)}data-validator='{Zend_Json::encode($SPECIAL_VALIDATOR)}'{/if} data-selected-value='{$FIELD_MODEL->get('fieldvalue')}' + {if $FIELD_INFO["mandatory"] eq true} data-rule-required="true" {/if} + {if count($FIELD_INFO['validator'])} + data-specific-rules='{ZEND_JSON::encode($FIELD_INFO["validator"])}' + {/if} + {if $FIELD_MODEL->getFieldName() eq 'targetmodule' and $MODE eq 'edit'}disabled='disabled'{/if} + > + {if $FIELD_MODEL->isEmptyPicklistOptionAllowed()}<option value="">{vtranslate('LBL_SELECT_OPTION','Vtiger')}</option>{/if} + {foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES} + {assign var=CLASS_NAME value="picklistColor_{$FIELD_MODEL->getFieldName()}_{$PICKLIST_NAME|replace:' ':'_'}"} + <option value="{Vtiger_Util_Helper::toSafeHTML($PICKLIST_NAME)}" {if $PICKLIST_COLORS[$PICKLIST_NAME]}class="{$CLASS_NAME}"{/if} {if trim(decode_html($FIELD_MODEL->get('fieldvalue'))) eq trim($PICKLIST_NAME)} selected {/if}>{$PICKLIST_VALUE}</option> + {/foreach} + </select> + {if $PICKLIST_COLORS} + <style type="text/css"> + {foreach item=PICKLIST_VALUE key=PICKLIST_NAME from=$PICKLIST_VALUES} + {assign var=CLASS_NAME value="{$FIELD_MODEL->getFieldName()}_{$PICKLIST_NAME|replace:' ':'_'}"} + .picklistColor_{$CLASS_NAME} { + background-color: {$PICKLIST_COLORS[$PICKLIST_NAME]} !important; + } + {/foreach} + </style> + {/if} +{/strip} diff --git a/pkg/vtiger/modules/Webforms/modules/Webforms/capture.php b/pkg/vtiger/modules/Webforms/modules/Webforms/capture.php index 1c3e19954..1057ce381 100644 --- a/pkg/vtiger/modules/Webforms/modules/Webforms/capture.php +++ b/pkg/vtiger/modules/Webforms/modules/Webforms/capture.php @@ -20,6 +20,7 @@ include_once 'modules/Webforms/model/WebformsFieldModel.php'; include_once 'include/QueryGenerator/QueryGenerator.php'; include_once 'includes/runtime/EntryPoint.php'; include_once 'includes/main/WebUI.php'; +include_once 'include/Webservices/AddRelated.php'; class Webform_Capture { @@ -112,6 +113,7 @@ class Webform_Capture { // Create the record $record = vtws_create($webform->getTargetModule(), $parameters, $user); + $webform->createDocuments($record); $this->sendResponse($returnURL, 'ok'); return; diff --git a/pkg/vtiger/modules/Webforms/modules/Webforms/model/WebformsModel.php b/pkg/vtiger/modules/Webforms/modules/Webforms/model/WebformsModel.php index a6e6b275e..4942ba6bd 100644 --- a/pkg/vtiger/modules/Webforms/modules/Webforms/model/WebformsModel.php +++ b/pkg/vtiger/modules/Webforms/modules/Webforms/model/WebformsModel.php @@ -324,9 +324,63 @@ class Webforms_Model { $rows = $adb->num_rows($res); if ($rows > 0) { return true; - }else + } else { return false; + } + } + + /** + * Function to create document records for each submitted files in webform and relate to created target module record. + * @global $current_user + * @param <array> $wsRecord - Webservice record array of created target module record returned by vtws_create(). + * @throws Exception - Throws exception if size of all uploaded files exceeds 50MB. + */ + function createDocuments($wsRecord) { + global $current_user; + $createdDocumentRecords = array(); + $sourceModule = $this->getTargetModule(); + if (Vtiger_Functions::isDocumentsRelated($sourceModule)) { + $allFileSize = 0; + foreach ($_FILES as $file) { + $allFileSize += $file['size']; + } + + $recordModel = Settings_Webforms_Record_Model::getInstanceById($this->getId(), 'Settings:Webforms'); + $allowedFilesSize = $recordModel->getModule()->allowedAllFilesSize(); + if ($allFileSize > $allowedFilesSize) { + throw new Exception('Allowed files size exceeded. Allowed file size including all files is 50MB.'); + } + + $fileFields = $recordModel->getFileFields(); + $fileFieldsArray = array(); + $fileFieldsNameArray = array(); + foreach ($fileFields as $fileField) { + $fileFieldsArray[$fileField['fieldname']] = $fileField['fieldlabel']; + $fileFieldsNameArray[] = $fileField['fieldname']; + } + + $uploadedFiles = $_FILES; + foreach ($uploadedFiles as $fileFieldName => $uploadedFile) { + if (in_array($fileFieldName, $fileFieldsNameArray) && $uploadedFile['error'] == 0 && $uploadedFile['name']) { + $data['notes_title'] = $fileFieldsArray[$fileFieldName]; + $data['document_source'] = 'Vtiger'; + $data['filename'] = $uploadedFile['name']; + $data['filelocationtype'] = 'I'; + $data['source'] = 'WEBFORM'; + $data['assigned_user_id'] = $wsRecord['assigned_user_id']; + $data['filestatus'] = 1; + unset($_FILES); + $_FILES['filename'] = $uploadedFile; + $record = vtws_create('Documents', $data, $current_user); + array_push($createdDocumentRecords, $record['id']); + } + } + + if (!empty($createdDocumentRecords)) { + vtws_add_related($wsRecord['id'], $createdDocumentRecords); + } + } } } -?> +?> \ No newline at end of file diff --git a/pkg/vtiger/modules/Webforms/settings/actions/Save.php b/pkg/vtiger/modules/Webforms/settings/actions/Save.php index 328b3cffc..d7631e83e 100644 --- a/pkg/vtiger/modules/Webforms/settings/actions/Save.php +++ b/pkg/vtiger/modules/Webforms/settings/actions/Save.php @@ -42,6 +42,12 @@ class Settings_Webforms_Save_Action extends Settings_Vtiger_Index_Action { $recordModel->set($fieldName, $fieldValue); } + $fileFields = array(); + if (is_array($request->get('file_field'))) { + $fileFields = $request->get('file_field'); + } + $recordModel->set('file_fields', $fileFields); + $returnUrl = $recordModel->getModule()->getListViewUrl(); $recordModel->set('selectedFieldsData', $request->get('selectedFieldsData')); if (!$recordModel->checkDuplicate()) { diff --git a/pkg/vtiger/modules/Webforms/settings/models/Module.php b/pkg/vtiger/modules/Webforms/settings/models/Module.php index 6f4c61362..5b438d581 100644 --- a/pkg/vtiger/modules/Webforms/settings/models/Module.php +++ b/pkg/vtiger/modules/Webforms/settings/models/Module.php @@ -15,6 +15,7 @@ class Settings_Webforms_Module_Model extends Settings_Vtiger_Module_Model { var $nameFields = array('name'); var $listFields = array('name'=>'WebForm Name', 'targetmodule' => 'Module', 'publicid'=>'Public Id', 'returnurl' => 'Return Url', 'enabled' => 'Status'); var $name = 'Webforms'; + var $allowedAllFilesSize = 52428800; //50MB public static function getSupportedModulesList() { $webformModules = array('Contacts', 'Accounts', 'Leads', 'Potentials', 'HelpDesk', 'Vendors'); @@ -118,4 +119,8 @@ class Settings_Webforms_Module_Model extends Settings_Vtiger_Module_Model { function isStarredEnabled(){ return false; } + + public function allowedAllFilesSize() { + return $this->allowedAllFilesSize; + } } diff --git a/pkg/vtiger/modules/Webforms/settings/models/Record.php b/pkg/vtiger/modules/Webforms/settings/models/Record.php index 55a192eec..92594d4ca 100644 --- a/pkg/vtiger/modules/Webforms/settings/models/Record.php +++ b/pkg/vtiger/modules/Webforms/settings/models/Record.php @@ -121,6 +121,7 @@ class Settings_Webforms_Record_Model extends Settings_Vtiger_Record_Model { $linkTypes = array('DETAILVIEWBASIC'); $moduleModel = $this->getModule(); $recordId = $this->getId(); + $linkModelList = array(); $detailViewLinks = array( array( @@ -338,7 +339,42 @@ class Settings_Webforms_Record_Model extends Settings_Vtiger_Record_Model { } array_push($params, $fieldName, $neutralizedField, $fieldDefaultValue, $fieldDetails['required'], $fieldDetails['sequence'], $fieldDetails['hidden']); $db->pquery($fieldInsertQuery, $params); + } + + //Handling document file fields save + $fileFields = $this->get('file_fields'); + $db->pquery('DELETE FROM vtiger_webform_file_fields WHERE webformid = ?', array($this->getId())); + $fileFieldQuery = 'INSERT INTO vtiger_webform_file_fields (webformid, fieldname, fieldlabel, required) VALUES (?, ?, ?, ?)'; + $i = 1; + foreach ($fileFields as $fileField) { + $fileFieldName = 'file_'.$this->getId().'_'.$i++; + $required = $fileField['required']; + if ($required != 1) { + $required = 0; + } + $params = array($this->getId(), $fileFieldName, $fileField['fieldlabel'], $required); + $db->pquery($fileFieldQuery, $params); + } } + + /** + * Function to get document file fields added in webform + * @return <Array> Array of added file fields information. + */ + function getFileFields() { + $fileFields = $this->get('file_fields'); + if (!$fileFields) { + $fileFields = array(); + $db = PearDatabase::getInstance(); + + $result = $db->pquery('SELECT * FROM vtiger_webform_file_fields WHERE webformid = ?', array($this->getId())); + $count = $db->num_rows($result); + for ($i = 0; $i < $count; $i++) { + $fileFields[$i] = $db->query_result_rowdata($result, $i); + } + $this->set('file_fields', $fileFields); + } + return $fileFields; } /** diff --git a/pkg/vtiger/modules/Webforms/settings/views/Detail.php b/pkg/vtiger/modules/Webforms/settings/views/Detail.php index bf9e017e7..88c2879b8 100644 --- a/pkg/vtiger/modules/Webforms/settings/views/Detail.php +++ b/pkg/vtiger/modules/Webforms/settings/views/Detail.php @@ -47,6 +47,7 @@ class Settings_Webforms_Detail_View extends Settings_Vtiger_Index_View { $viewer->assign('SOURCE_MODULE', $recordModel->get('targetmodule')); $viewer->assign('DETAILVIEW_LINKS', $recordModel->getDetailViewLinks()); $viewer->assign('SELECTED_FIELD_MODELS_LIST', $recordModel->getSelectedFieldsList()); + $viewer->assign('DOCUMENT_FILE_FIELDS', $recordModel->getFileFields()); $viewer->assign('NO_PAGINATION',true); $currentUserModel = Users_Record_Model::getCurrentUserModel(); diff --git a/pkg/vtiger/modules/Webforms/settings/views/Edit.php b/pkg/vtiger/modules/Webforms/settings/views/Edit.php index ad44fd788..221fd21dd 100644 --- a/pkg/vtiger/modules/Webforms/settings/views/Edit.php +++ b/pkg/vtiger/modules/Webforms/settings/views/Edit.php @@ -25,13 +25,14 @@ Class Settings_Webforms_Edit_View extends Settings_Vtiger_Index_View { $recordId = $request->get('record'); $qualifiedModuleName = $request->getModule(false); $mode = ''; - $selectedFieldsList = $allFieldsList = array(); + $selectedFieldsList = $allFieldsList = $fileFields = array(); $viewer = $this->getViewer($request); $supportedModules = Settings_Webforms_Module_Model::getSupportedModulesList(); if ($recordId) { $recordModel = Settings_Webforms_Record_Model::getInstanceById($recordId, $qualifiedModuleName); $selectedFieldsList = $recordModel->getSelectedFieldsList(); + $fileFields = $recordModel->getFileFields(); $sourceModule = $recordModel->get('targetmodule'); $mode = 'edit'; @@ -65,6 +66,7 @@ Class Settings_Webforms_Edit_View extends Settings_Vtiger_Index_View { $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructure); $viewer->assign('RECORD_STRUCTURE', $recordStructure->getStructure()); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); + $viewer->assign('DOCUMENT_FILE_FIELDS', $fileFields); $viewer->view('EditView.tpl', $qualifiedModuleName); } diff --git a/pkg/vtiger/modules/Webforms/settings/views/GetSourceModuleFields.php b/pkg/vtiger/modules/Webforms/settings/views/GetSourceModuleFields.php index 83fde05f1..0cdbafe69 100644 --- a/pkg/vtiger/modules/Webforms/settings/views/GetSourceModuleFields.php +++ b/pkg/vtiger/modules/Webforms/settings/views/GetSourceModuleFields.php @@ -28,6 +28,7 @@ class Settings_Webforms_GetSourceModuleFields_View extends Settings_Vtiger_Index $viewer = $this->getViewer($request); $mode = ''; $selectedFieldsList = array(); + $fileFields = array(); if ($recordId) { $recordModel = Settings_Webforms_Record_Model::getInstanceById($recordId, $qualifiedModuleName); @@ -35,6 +36,7 @@ class Settings_Webforms_GetSourceModuleFields_View extends Settings_Vtiger_Index if ($sourceModule === $recordModel->get('targetmodule')) { $selectedFieldsList = $recordModel->getSelectedFieldsList(); } + $fileFields = $recordModel->getFileFields(); } else { $recordModel = Settings_Webforms_Record_Model::getCleanInstance($qualifiedModuleName); } @@ -42,6 +44,8 @@ class Settings_Webforms_GetSourceModuleFields_View extends Settings_Vtiger_Index $viewer->assign('MODE', $mode); $viewer->assign('SOURCE_MODULE', $sourceModule); $viewer->assign('MODULE', $qualifiedModuleName); + $viewer->assign('DOCUMENT_FILE_FIELDS', $fileFields); + $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName); $viewer->assign('SELECTED_FIELD_MODELS_LIST', $selectedFieldsList); $viewer->assign('ALL_FIELD_MODELS_LIST', $recordModel->getAllFieldsList($sourceModule)); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); diff --git a/pkg/vtiger/modules/Webforms/settings/views/ShowForm.php b/pkg/vtiger/modules/Webforms/settings/views/ShowForm.php index a295979b2..91cffb477 100644 --- a/pkg/vtiger/modules/Webforms/settings/views/ShowForm.php +++ b/pkg/vtiger/modules/Webforms/settings/views/ShowForm.php @@ -41,6 +41,8 @@ Class Settings_Webforms_ShowForm_View extends Settings_Vtiger_IndexAjax_View { $viewer->assign('ACTION_PATH', $siteUrl.'modules/Webforms/capture.php'); $viewer->assign('CAPTCHA_PATH', $siteUrl.'modules/Settings/Webforms/actions/CheckCaptcha.php'); $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel()); + $viewer->assign('DOCUMENT_FILE_FIELDS', $recordModel->getFileFields()); + $viewer->assign('ALLOWED_ALL_FILES_SIZE', $recordModel->getModule()->allowedAllFilesSize()); echo $viewer->view('ShowForm.tpl', $qualifiedModuleName); } diff --git a/pkg/vtiger/translations/Arabic_ar_ae/modules/Settings/Webforms.php b/pkg/vtiger/translations/Arabic_ar_ae/modules/Settings/Webforms.php index 16cb07ea5..8615cfe7a 100644 --- a/pkg/vtiger/translations/Arabic_ar_ae/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Arabic_ar_ae/modules/Settings/Webforms.php @@ -45,6 +45,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'إضاÙØ© Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'وثائق للتØميل', + 'LBL_ADD_FILE_FIELD' => 'رÙع مل٠الميدان', + 'LBL_FIELD_LABEL' => 'عنوان الوثيقة', + 'LBL_FILE_FIELD_INFO' => 'لكل مل٠مرÙوع من على شبكة الإنترنت تشكل يتم إنشاء وثيقة جديدة مع المل٠المرÙÙ‚. يرتبط الوثيقة أيضا إلى هذه المنشأة Øديثا٪ الصورة.', + 'LBL_NO_FILE_FIELD' => 'وأضاÙت أية Øقول الملÙ.', + 'LBL_COPY_TO_CLIPBOARD' => 'نسخ إلى الØاÙظة', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', @@ -55,4 +61,8 @@ $jsLanguageStrings = array( 'JS_REFERENCE_FIELDS_CANT_BE_MANDATORY_WITHOUT_OVERRIDE_VALUE' => 'الØقول المرجعية غير قادر على أن يكون إلزاميا دون تجاوز القيمة', 'JS_TYPE_TO_SEARCH' => 'اكتب للبØØ«', "JS_WEBFORM_WITH_THIS_NAME_ALREADY_EXISTS" => 'يبÙورم مع هذا الاسم موجود بالÙعل', + + 'JS_MAX_FILE_FIELDS_LIMIT' => 'الØد الأقصى الذي يمكن أن تضيÙÙª الصورة Øقول الملÙ.', + 'JS_COPIED_SUCCESSFULLY' => 'نسخ بنجاØ.', + 'JS_COPY_FAILED' => 'Ùشل نسخة. يرجى نسخ يدويا.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/BrazilianLanguagePack_bz_bz/modules/Settings/Webforms.php b/pkg/vtiger/translations/BrazilianLanguagePack_bz_bz/modules/Settings/Webforms.php index c29b9bbe2..5776c35ed 100644 --- a/pkg/vtiger/translations/BrazilianLanguagePack_bz_bz/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/BrazilianLanguagePack_bz_bz/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Adicionar Formulário De Web', + 'LBL_UPLOAD_DOCUMENTS' => 'upload de documentos', + 'LBL_ADD_FILE_FIELD' => 'Arquivo Carregar Campo', + 'LBL_FIELD_LABEL' => 'TÃtulo do documento', + 'LBL_FILE_FIELD_INFO' => 'Para cada arquivo carregado a partir de web formar um novo documento é criado com o arquivo anexado. Documento também está ligada a este recém-criado%s.', + 'LBL_NO_FILE_FIELD' => 'Não há campos de arquivo adicionado.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copiar para área de transferência', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Selecione uma Opção', 'JS_LABEL' => 'rótulo', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Máximo que você pode adicionar%s campos de arquivo.', + 'JS_COPIED_SUCCESSFULLY' => 'Copiado com êxito.', + 'JS_COPY_FAILED' => 'Cópia falhou. Por favor, copie manualmente.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/BritishLanguagePack_br_br/modules/Settings/Webforms.php b/pkg/vtiger/translations/BritishLanguagePack_br_br/modules/Settings/Webforms.php index ecc31956a..cfb81f4b4 100644 --- a/pkg/vtiger/translations/BritishLanguagePack_br_br/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/BritishLanguagePack_br_br/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Add Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'Upload Documents', + 'LBL_ADD_FILE_FIELD' => 'File Upload Field', + 'LBL_FIELD_LABEL' => 'Document Title', + 'LBL_FILE_FIELD_INFO' => 'For each file uploaded from web form a new Document is created with the attached file. Document is also linked to this newly created %s.', + 'LBL_NO_FILE_FIELD' => 'No file fields added.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copy to clipboard', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Select an Option', 'JS_LABEL' => 'label', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximum you can add %s file fields.', + 'JS_COPIED_SUCCESSFULLY' => 'Copied successfully.', + 'JS_COPY_FAILED' => 'Copy failed. Please copy manually.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Deutsch/modules/Settings/Webforms.php b/pkg/vtiger/translations/Deutsch/modules/Settings/Webforms.php index 4d58f2acd..347516b48 100644 --- a/pkg/vtiger/translations/Deutsch/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Deutsch/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Hinzufügen Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'hochladen von Dokumenten', + 'LBL_ADD_FILE_FIELD' => 'Datei-Upload-Feld', + 'LBL_FIELD_LABEL' => 'Dokumenttitel', + 'LBL_FILE_FIELD_INFO' => 'Für jede Datei von Web hochgeladen hat ein neues Dokument bildet, wird mit der angehängten Datei erstellt. Das Dokument wird auch auf dieses neu geschaffenen%s verbunden.', + 'LBL_NO_FILE_FIELD' => 'Keine Dateifelder hinzugefügt.', + 'LBL_COPY_TO_CLIPBOARD' => 'In die Zwischenablage kopieren', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Wählen Sie eine Option', 'JS_LABEL' => 'label', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximal können Sie%s Dateifelder hinzufügen.', + 'JS_COPIED_SUCCESSFULLY' => 'erfolgreich kopiert.', + 'JS_COPY_FAILED' => 'Kopieren fehlgeschlagen. Bitte kopieren Sie manuell.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Dutch/modules/Settings/Webforms.php b/pkg/vtiger/translations/Dutch/modules/Settings/Webforms.php index ca8b7dd3c..684750f91 100644 --- a/pkg/vtiger/translations/Dutch/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Dutch/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Toevoegen Webformulier', + 'LBL_UPLOAD_DOCUMENTS' => 'Upload Documents', + 'LBL_ADD_FILE_FIELD' => 'Bestanden uploaden Field', + 'LBL_FIELD_LABEL' => 'Document titel', + 'LBL_FILE_FIELD_INFO' => 'Voor elk bestand geüpload van web vormen een nieuw document wordt gemaakt met het bijgevoegde bestand. Het document is ook gekoppeld aan deze nieuw gecreëerde%s.', + 'LBL_NO_FILE_FIELD' => 'Geen bestand velden toegevoegd.', + 'LBL_COPY_TO_CLIPBOARD' => 'Kopieer naar klembord', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Selecteer een Optie', 'JS_LABEL' => 'label', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximaal kun je%s bestand velden toe te voegen.', + 'JS_COPIED_SUCCESSFULLY' => 'gekopieerd.', + 'JS_COPY_FAILED' => 'Kopiëren mislukt. Gelieve handmatig te kopiëren.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/French/modules/Settings/Webforms.php b/pkg/vtiger/translations/French/modules/Settings/Webforms.php index 393ba7901..0ad7f03d7 100644 --- a/pkg/vtiger/translations/French/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/French/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Ajouter Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'Documents Téléchargement', + 'LBL_ADD_FILE_FIELD' => 'File Upload champs', + 'LBL_FIELD_LABEL' => 'Titre du document', + 'LBL_FILE_FIELD_INFO' => 'Pour chaque fichier téléchargé du web forment un nouveau document est créé avec le fichier joint. Le document est également lié à ce nouveau%s.', + 'LBL_NO_FILE_FIELD' => 'Aucun champ de fichier ajouté.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copier dans le presse-papier', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Sélectionnez une Option', 'JS_LABEL' => 'étiquette', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximum vous pouvez ajouter des champs de fichiers%.', + 'JS_COPIED_SUCCESSFULLY' => 'Copié avec succès.', + 'JS_COPY_FAILED' => "Échec de la copie. S'il vous plaît copier manuellement.", ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Hungarian/modules/Settings/Webforms.php b/pkg/vtiger/translations/Hungarian/modules/Settings/Webforms.php index 73667d1ac..8ae26626a 100644 --- a/pkg/vtiger/translations/Hungarian/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Hungarian/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Add Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'Dokumentumok feltöltése', + 'LBL_ADD_FILE_FIELD' => 'Fájl feltöltés Field', + 'LBL_FIELD_LABEL' => 'Dokumentum cÃme', + 'LBL_FILE_FIELD_INFO' => 'Minden feltöltött fájlnak a web egy új dokumentum jön létre a csatolt fájlt. A dokumentum is összefügg, hogy az újonnan létrehozott%s.', + 'LBL_NO_FILE_FIELD' => 'Nincs fájl területeken hozzá.', + 'LBL_COPY_TO_CLIPBOARD' => 'Másolja a vágólapra', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Válasszon ki egy LehetÅ‘séget', 'JS_LABEL' => 'cÃmke', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximum felveheti%s fájl területeken.', + 'JS_COPIED_SUCCESSFULLY' => 'Sikeresen másolt.', + 'JS_COPY_FAILED' => 'Másolás sikertelen. Kérjük, másolja kézzel.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/Settings/Webforms.php b/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/Settings/Webforms.php index 4f11be62d..d8ef4d3b9 100644 --- a/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/ItalianLanguagePack_it_it/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Aggiungere Webform', + 'LBL_UPLOAD_DOCUMENTS' => 'Carica Documenti', + 'LBL_ADD_FILE_FIELD' => 'File Upload Campo', + 'LBL_FIELD_LABEL' => 'Titolo del documento', + 'LBL_FILE_FIELD_INFO' => 'Per ogni file caricato da web formare un nuovo documento viene creato con il file allegato. Documento è legato anche a questa nuova creazione%s.', + 'LBL_NO_FILE_FIELD' => 'Nessun campo file aggiunti.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copia negli appunti', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Selezionare un\'Opzione', 'JS_LABEL' => 'etichetta', -); \ No newline at end of file + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Massima è possibile aggiungere campi del file%s.', + 'JS_COPIED_SUCCESSFULLY' => 'Copiato con successo.', + 'JS_COPY_FAILED' => 'Copia non riuscita. Si prega di copiare manualmente.', +); diff --git a/pkg/vtiger/translations/MexicanSpanishLanguagePack_es_mx/modules/Settings/Webforms.php b/pkg/vtiger/translations/MexicanSpanishLanguagePack_es_mx/modules/Settings/Webforms.php index 95093d3ef..e894758a9 100644 --- a/pkg/vtiger/translations/MexicanSpanishLanguagePack_es_mx/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/MexicanSpanishLanguagePack_es_mx/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Agregar Formulario Web', + 'LBL_UPLOAD_DOCUMENTS' => 'subir documentos', + 'LBL_ADD_FILE_FIELD' => 'El campo de carga de archivos', + 'LBL_FIELD_LABEL' => 'Titulo del documento', + 'LBL_FILE_FIELD_INFO' => 'Para cada archivo subido desde web formar un nuevo documento se crea con el archivo adjunto. El documento también está vinculada a este%s de nueva creación.', + 'LBL_NO_FILE_FIELD' => 'No hay campos de archivo añadido.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copiar al portapapeles', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Seleccione una Opción', 'JS_LABEL' => 'etiqueta', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Máximo que se puede añadir campos de ficheros%s.', + 'JS_COPIED_SUCCESSFULLY' => 'Copiado con éxito.', + 'JS_COPY_FAILED' => 'Copia falló. Por favor, copiar manualmente.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/PolishLanguagePack_pl_pl/modules/Settings/Webforms.php b/pkg/vtiger/translations/PolishLanguagePack_pl_pl/modules/Settings/Webforms.php index c27da2bd8..b20cb0082 100755 --- a/pkg/vtiger/translations/PolishLanguagePack_pl_pl/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/PolishLanguagePack_pl_pl/modules/Settings/Webforms.php @@ -45,6 +45,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Dodaj NastÄ™pujÄ…cÄ… FormÄ™', + 'LBL_UPLOAD_DOCUMENTS' => 'Dodaj Dokumenty', + 'LBL_ADD_FILE_FIELD' => 'File Upload Pole', + 'LBL_FIELD_LABEL' => 'TytuÅ‚ dokumentu', + 'LBL_FILE_FIELD_INFO' => 'Dla każdego pliku przesÅ‚anego z sieci tworzÄ…c nowy dokument jest tworzony z zaÅ‚Ä…czonym pliku. Dokument jest również zwiÄ…zany z tym nowo utworzonym%s.', + 'LBL_NO_FILE_FIELD' => 'Brak pola plików dodany.', + 'LBL_COPY_TO_CLIPBOARD' => 'Skopiuj do schowka', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully',//ToDo Review @@ -55,4 +61,8 @@ $jsLanguageStrings = array( 'JS_REFERENCE_FIELDS_CANT_BE_MANDATORY_WITHOUT_OVERRIDE_VALUE' => 'Pola referencyjne mogÄ™ być obowiÄ…zkowe bez wartoÅ›ci override', 'JS_TYPE_TO_SEARCH' => 'Typ wyszukiwania', "JS_WEBFORM_WITH_THIS_NAME_ALREADY_EXISTS" => 'Webform o tej nazwie już istnieje', + + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maksymalna można dodać pola pliku%s.', + 'JS_COPIED_SUCCESSFULLY' => 'Skopiowane z powodzeniem.', + 'JS_COPY_FAILED' => 'Kopiowanie nie powiodÅ‚o siÄ™. ProszÄ™ skopiować rÄ™cznie.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/RomanianLanguagePack_rm_rm/modules/Settings/Webforms.php b/pkg/vtiger/translations/RomanianLanguagePack_rm_rm/modules/Settings/Webforms.php index 4f05ec5ef..bd05a3633 100644 --- a/pkg/vtiger/translations/RomanianLanguagePack_rm_rm/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/RomanianLanguagePack_rm_rm/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Adăugare Formular Web', + 'LBL_UPLOAD_DOCUMENTS' => 'ÃŽncărcaÈ›i Documente', + 'LBL_ADD_FILE_FIELD' => 'FiÈ™ier de încărcare Câmp', + 'LBL_FIELD_LABEL' => 'Titlul documentului', + 'LBL_FILE_FIELD_INFO' => 'Pentru fiecare fiÈ™ier încărcat de web a forma un nou document este creat cu fiÈ™ierul ataÈ™at. Documentul este, de asemenea, legat de acest nou creat%s.', + 'LBL_NO_FILE_FIELD' => 'Nu există câmpuri de fiÈ™iere adăugate.', + 'LBL_COPY_TO_CLIPBOARD' => 'CopiaÈ›i în clipboard', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'SelectaÈ›i o opÈ›iune', 'JS_LABEL' => 'tag-uri', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maxim puteÈ›i adăuga%s câmpuri de fiÈ™iere.', + 'JS_COPIED_SUCCESSFULLY' => 'Copiată cu succes.', + 'JS_COPY_FAILED' => 'Copiere nu a reuÈ™it. Vă rugăm să copiaÈ›i manual.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Russian/modules/Settings/Webforms.php b/pkg/vtiger/translations/Russian/modules/Settings/Webforms.php index deda73f68..9416eb4ca 100644 --- a/pkg/vtiger/translations/Russian/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Russian/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Добавить Веб-Форму', + 'LBL_UPLOAD_DOCUMENTS' => 'Загрузить документы', + 'LBL_ADD_FILE_FIELD' => 'Файл Загрузить поле', + 'LBL_FIELD_LABEL' => 'Заголовок документа', + 'LBL_FILE_FIELD_INFO' => 'Ð”Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ файла, загруженного из Интернета формируют новый документ ÑоздаетÑÑ Ñ Ð²Ð»Ð¾Ð¶ÐµÐ½Ð½Ñ‹Ð¼ файлом. Документ также ÑвÑзан Ñ Ñтой вновь Ñозданной% Ñ.', + 'LBL_NO_FILE_FIELD' => 'Ðет файлов полей не добавлено.', + 'LBL_COPY_TO_CLIPBOARD' => 'Скопировать в буфер обмена', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform уÑпешно удален', @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Выберите вариант', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'МакÑÐ¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð²Ñ‹ можете добавить%s Ð¿Ð¾Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð².', + 'JS_COPIED_SUCCESSFULLY' => 'Скопировано уÑпешно.', + 'JS_COPY_FAILED' => 'Копирование не удалоÑÑŒ. ПожалуйÑта, Ñкопируйте вручную.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Spanish/modules/Settings/Webforms.php b/pkg/vtiger/translations/Spanish/modules/Settings/Webforms.php index 7fa7af17c..1c6adfe0a 100644 --- a/pkg/vtiger/translations/Spanish/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Spanish/modules/Settings/Webforms.php @@ -52,6 +52,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Agregar Formulario Web', + 'LBL_UPLOAD_DOCUMENTS' => 'subir documentos', + 'LBL_ADD_FILE_FIELD' => 'El campo de carga de archivos', + 'LBL_FIELD_LABEL' => 'Titulo del documento', + 'LBL_FILE_FIELD_INFO' => 'Para cada archivo subido desde web formar un nuevo documento se crea con el archivo adjunto. El documento también está vinculada a este%s de nueva creación.', + 'LBL_NO_FILE_FIELD' => 'No hay campos de archivo añadido.', + 'LBL_COPY_TO_CLIPBOARD' => 'Copiar al portapapeles', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Se ha eliminado el formulario correctamente', @@ -65,4 +71,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Seleccione una Opción', 'JS_LABEL' => 'etiqueta', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Máximo que se puede añadir campos de ficheros%s.', + 'JS_COPIED_SUCCESSFULLY' => 'Copiado con éxito.', + 'JS_COPY_FAILED' => 'Copia falló. Por favor, copiar manualmente.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/Sweden_sv_se/modules/Settings/Webforms.php b/pkg/vtiger/translations/Sweden_sv_se/modules/Settings/Webforms.php index 467c6053d..0274e2bf9 100755 --- a/pkg/vtiger/translations/Sweden_sv_se/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/Sweden_sv_se/modules/Settings/Webforms.php @@ -46,6 +46,12 @@ $languageStrings = array( 'SINGLE_Webforms' => 'Webbformulär', 'LBL_ADD_RECORD' => 'Lägg Till Webbformulär', + 'LBL_UPLOAD_DOCUMENTS' => 'Ladda upp dokument', + 'LBL_ADD_FILE_FIELD' => 'Filuppladdning Field', + 'LBL_FIELD_LABEL' => 'Dokument titel', + 'LBL_FILE_FIELD_INFO' => 'För varje fil laddas upp frÃ¥n web bilda ett nytt dokument skapas med bifogad fil. Dokumentet är ocksÃ¥ kopplat till detta nyskapade%s.', + 'LBL_NO_FILE_FIELD' => 'Ingen fil fält läggs.', + 'LBL_COPY_TO_CLIPBOARD' => 'Kopiera till urklipp', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webbformulär raderats framgÃ¥ngsrikt', @@ -56,4 +62,8 @@ $jsLanguageStrings = array( 'JS_REFERENCE_FIELDS_CANT_BE_MANDATORY_WITHOUT_OVERRIDE_VALUE' => 'Referensfält kan inte vara obligatoriskt utan överbelastningsvärde', 'JS_TYPE_TO_SEARCH' => 'Skriv för att söka', "JS_WEBFORM_WITH_THIS_NAME_ALREADY_EXISTS" => 'Webbformulär med detta namn finns redan', + + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maximalt kan du lägga till%s fil fält.', + 'JS_COPIED_SUCCESSFULLY' => 'Kopierats.', + 'JS_COPY_FAILED' => 'Kopiera misslyckades. Kopiera manuellt.', ); \ No newline at end of file diff --git a/pkg/vtiger/translations/TurkishLanguagePack_tr_tr/modules/Settings/Webforms.php b/pkg/vtiger/translations/TurkishLanguagePack_tr_tr/modules/Settings/Webforms.php index 3062b551a..dcf62145c 100644 --- a/pkg/vtiger/translations/TurkishLanguagePack_tr_tr/modules/Settings/Webforms.php +++ b/pkg/vtiger/translations/TurkishLanguagePack_tr_tr/modules/Settings/Webforms.php @@ -40,6 +40,12 @@ $languageStrings = array( 'LBL_ADD_RECORD' => 'Web Formunu Ekleyin', + 'LBL_UPLOAD_DOCUMENTS' => 'Yükleme Belgeler', + 'LBL_ADD_FILE_FIELD' => 'Yükleme Field Dosya', + 'LBL_FIELD_LABEL' => 'Belge baÅŸlığı', + 'LBL_FILE_FIELD_INFO' => "Web'den yüklenen her dosya için yeni bir belge ekli dosya ile oluÅŸturulur oluÅŸtururlar. Belge de bu yeni oluÅŸturulan%s ile baÄŸlantılıdır.", + 'LBL_NO_FILE_FIELD' => 'Hiçbir dosya alanları eklendi.', + 'LBL_COPY_TO_CLIPBOARD' => 'Panoya kopyala', ); $jsLanguageStrings = array( 'JS_WEBFORM_DELETED_SUCCESSFULLY' => 'Webform deleted successfully', // TODO: Review @@ -53,4 +59,7 @@ $jsLanguageStrings = array( 'JS_SELECT_AN_OPTION' => 'Bir Seçenek belirleyin', 'JS_LABEL' => 'etiket', + 'JS_MAX_FILE_FIELDS_LIMIT' => 'Maksimum EÄŸer%s dosyası alanları ekleyebilirsiniz.', + 'JS_COPIED_SUCCESSFULLY' => 'BaÅŸarıyla kopyalandı.', + 'JS_COPY_FAILED' => 'Kopya baÅŸarısız oldu. El ile kopyalayın.', ); \ No newline at end of file diff --git a/vtlib/Vtiger/Functions.php b/vtlib/Vtiger/Functions.php index 3413a8fdf..0f6fee2d1 100644 --- a/vtlib/Vtiger/Functions.php +++ b/vtlib/Vtiger/Functions.php @@ -1386,4 +1386,26 @@ class Vtiger_Functions { } while ($sizeInBytes > 1024); return round($sizeInBytes, 2) . $fileSizeUnits[$i]; } + + /** + * Function to check if a module($sourceModule) is related to Documents module. + * @param <string> $sourceModule - Source module + * @return <boolean> Returns TRUE if $sourceModule is related to Documents module and + * Documents module is active else returns FALSE. + */ + static function isDocumentsRelated($sourceModule) { + $isRelated = false; + $moduleName = 'Documents'; + if (vtlib_isModuleActive($moduleName)) { + $moduleModel = Vtiger_Module_Model::getInstance($moduleName); + $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule); + if ($moduleModel && $sourceModuleModel) { + $relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $moduleModel); + } + if ($relationModel) { + $isRelated = true; + } + } + return $isRelated; + } } -- GitLab