Commit 6bc4923e712793a5d4b14c13eaf84602cbbfc992

Authored by Charl Joseph Mert
1 parent d8798e7e

When doing a Bulk Upload the Large Text Field is not available as MCE.

Jira:KTC-810

Fixed Date Field extJs 'div_' attribute naming to enable the form to properly handle submits.

Committed by: Charl Joseph Mert
Reviewed by: Megan Watson
plugins/multiselect/BulkImport.php 100644 → 100755
... ... @@ -292,14 +292,17 @@ class InetBulkImportFolderMultiSelectAction extends KTFolderAction {
292 292 // name='metadata[fieldset][metadata_9]'
293 293  
294 294 $aData = $_REQUEST['data'];
  295 + $data = $aData;
295 296  
  297 + /*
296 298 $oForm = $this->getBulkImportForm();
297 299 $res = $oForm->validate();
298 300 if (!empty($res['errors'])) {
299 301 return $oForm->handleError();
300 302 }
301 303 $data = $res['results'];
302   -
  304 + */
  305 +
303 306 $doctypeid = $requestDocumentType;
304 307 $aGenericFieldsetIds = KTFieldset::getGenericFieldsets(array('ids' => false));
305 308 $aSpecificFieldsetIds = KTFieldset::getForDocumentType($doctypeid, array('ids' => false));
... ... @@ -312,6 +315,7 @@ class InetBulkImportFolderMultiSelectAction extends KTFolderAction {
312 315  
313 316 foreach ($fields as $oField) {
314 317 $val = KTUtil::arrayGet($values, 'metadata_' . $oField->getId());
  318 +
315 319 if ($oFieldset->getIsConditional())
316 320 {
317 321 if ($val == _kt('No selection.'))
... ... @@ -319,16 +323,16 @@ class InetBulkImportFolderMultiSelectAction extends KTFolderAction {
319 323 $val = null;
320 324 }
321 325 }
322   -
  326 +
323 327 if (!is_null($val)) {
324 328 $MDPack[] = array(
325 329 $oField,
326 330 $val
327 331 );
328 332 }
329   -
  333 +
330 334 }
331   - }
  335 + }
332 336  
333 337 $aOptions = array(
334 338 'documenttype' => $oDocumentType,
... ... @@ -340,7 +344,7 @@ class InetBulkImportFolderMultiSelectAction extends KTFolderAction {
340 344 $po->start();
341 345 $oUploadChannel =& KTUploadChannel::getSingleton();
342 346 $oUploadChannel->addObserver($po);
343   -
  347 +
344 348 $fs =& new KTFSImportStorage($sPath);
345 349 $bm =& new KTBulkImportManager($this->oFolder, $fs, $this->oUser, $aOptions);
346 350 if(KTPluginUtil::pluginIsActive('inet.foldermetadata.plugin'))
... ...
plugins/multiselect/BulkUpload.php 100644 → 100755
... ... @@ -330,7 +330,6 @@ class InetBulkUploadFolderAction extends KTFolderAction {
330 330 foreach ($fields as $oField) {
331 331 //var_dump($oField->getId());
332 332 $val = KTUtil::arrayGet($values, 'metadata_' . $oField->getId());
333   - //var_dump($val);
334 333 if ($oFieldset->getIsConditional())
335 334 {
336 335 if ($val == _kt('No selection.'))
... ...
resources/js/kt_bulkupload.js
... ... @@ -30,7 +30,7 @@ function swapInItem(docId, elementId, req) {
30 30 var elems = jQuery(document).find(".kt_date_field");
31 31 for (i = 0; i < elems.length; i++) {
32 32 var fieldName = elems[i].id;
33   - //alert(fieldName);
  33 +
34 34 isGeneric = false;
35 35 if (genericFields.indexOf(fieldName.match('metadata_[0-9]+')) >= 0){
36 36 isGeneric = true;
... ... @@ -38,7 +38,7 @@ function swapInItem(docId, elementId, req) {
38 38  
39 39 if (!isGeneric){
40 40 var dp = new Ext.form.DateField({
41   - name: fieldName,
  41 + name: fieldName.replace('div_', ''),
42 42 allowBlank:false,
43 43 size:10,
44 44 format: 'Y-m-d',
... ...
templates/ktcore/forms/widgets/date.smarty
1 1 <!--------------------------------------
2 2 ---- Changes for Custom Fields -----
3 3 -------------------------------------->
4   -<div name="div_{$name}" id="div_{$name}" class="kt_date_field"></div>
  4 +<div name="{$name}" id="div_{$name}" class="kt_date_field"></div>
5 5  
6 6 {literal}
7 7 <script type="text/javascript">
... ...