Skip to content

Commit

Permalink
update batch refresh page formatting and show error details - [issue #6]
Browse files Browse the repository at this point in the history
  • Loading branch information
mah0001 committed Apr 27, 2019
1 parent deef453 commit 50c4a89
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 11 additions & 1 deletion application/controllers/admin/Catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,21 @@ function refresh($id=NULL)
'errors'=>$e->GetValidationErrors()
);

$error_str='Validation Error<br/><pre class="error-pre">'.print_r($e->GetValidationErrors(),true).'</pre>';
$error_str='Validation Error<br/><pre class="error-pre">'.print_r($e->GetValidationErrors(),true).'</pre>';

if ($is_ajax){
die (json_encode(array('error'=>$error_str) ));
}

$this->session->set_flashdata('error', $error_str);
redirect('admin/catalog/edit/'.$id,'refresh');return;
}
catch(Exception $e){

if ($is_ajax){
die (json_encode(array('error'=>$e->getMessage()) ));
}

$this->session->set_flashdata('error', $e->getMessage());
redirect('admin/catalog/edit/'.$id,'refresh');return;
}
Expand Down
11 changes: 6 additions & 5 deletions application/views/catalog/ddi_batch_refresh.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<?php echo ($error!="") ? '<div class="error">'.$error.'</div>' : '';?>

<h1 class="page-title"><?php echo t('ddi_batch_refresh_title');?></h1>
<p><?php echo t('refresh_ddi_description');?></p>
<p><?php echo t('refresh_ddi_description');?> <input type="button" class="btn btn-primary" name="refresh" value="<?php echo t('btn_refresh');?>" onclick="batch_import.process();"/></p>


<div>

<?php if ( count($surveys)==0 || $surveys===false) :?>
Expand All @@ -23,10 +25,9 @@
<div id="batch-import-log" ></div>
</div>

<?php echo form_open_multipart('admin/catalog/batch_refresh', array('class'=>'form') );?>
<input type="button" name="refresh" value="<?php echo t('btn_refresh');?>" onclick="batch_import.process();"/>
<?php echo form_open_multipart('admin/catalog/batch_refresh', array('class'=>'form'));?>

<table class="grid-table" width="100%" cellspacing="0" cellpadding="0">
<table class="grid-table table table-striped" width="100%" cellspacing="0" cellpadding="0">
<tr align="left" class="header">
<th><input type="checkbox" value="-1" id="chk_toggle"/></th>
<th><?php echo t('id');?></th>
Expand All @@ -42,7 +43,7 @@
</tr>
<?php endforeach;?>
</table>
<input type="button" name="refresh" value="<?php echo t('btn_refresh');?>" onclick="batch_import.process();"/>
<input class="btn btn-primary" type="button" name="refresh" value="<?php echo t('btn_refresh');?>" onclick="batch_import.process();"/>
<?php echo form_close();?>
</div>

Expand Down

0 comments on commit 50c4a89

Please sign in to comment.