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