This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/modules/export/classes/Controller/Admin/Export.php
2013-10-10 13:44:53 +11:00

60 lines
1.5 KiB
PHP

<?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() {
}
}
?>