Open Source Billing
This commit is contained in:
59
modules/export/classes/Controller/Admin/Export.php
Normal file
59
modules/export/classes/Controller/Admin/Export.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides OSB exporting capabilities.
|
||||
*
|
||||
* @package Export
|
||||
* @category Controllers/Admin
|
||||
* @author Deon George
|
||||
* @copyright (c) 2009-2013 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Admin_Export extends Controller_TemplateDefault_Admin {
|
||||
protected $control_title = 'Export';
|
||||
protected $secure_actions = array(
|
||||
'add'=>TRUE,
|
||||
'edit'=>TRUE,
|
||||
);
|
||||
|
||||
/**
|
||||
* Add Export Maping items
|
||||
*/
|
||||
public function action_add() {
|
||||
$eo = ORM::factory('Export');
|
||||
$output = '';
|
||||
|
||||
if ($_POST AND $eo->values($_POST)->check()) {
|
||||
$eo->module_id = ORM::factory('Module',array('name'=>'product'))->id; // @todo This probably should be in the form.
|
||||
$eo->plugin_name = 'quicken'; // @todo This should be in the form.
|
||||
// Entry updated
|
||||
if (! $eo->save())
|
||||
throw new Kohana_Exception('Unable to save data :post',array(':post'=>serialize($_POST)));
|
||||
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record add'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Export Map entry added.')
|
||||
));
|
||||
}
|
||||
|
||||
$output .= Form::open();
|
||||
$output .= View::factory($this->viewpath())
|
||||
->set('eo',$eo);
|
||||
|
||||
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Add Export Map'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Export Maping items
|
||||
*/
|
||||
public function action_edit() {
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user