2010-11-29 22:41:08 +00:00
|
|
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class provides OSB exporting capabilities.
|
|
|
|
*
|
|
|
|
* @package OSB
|
|
|
|
* @subpackage Export
|
|
|
|
* @category Controllers/Admin
|
|
|
|
* @author Deon George
|
|
|
|
* @copyright (c) 2010 Open Source Billing
|
|
|
|
* @license http://dev.osbill.net/license.html
|
|
|
|
*/
|
2011-08-26 01:16:48 +00:00
|
|
|
class Controller_Admin_Export extends Controller_TemplateDefault_Admin {
|
2010-11-29 22:41:08 +00:00
|
|
|
protected $control_title = 'Export';
|
2011-08-26 01:16:48 +00:00
|
|
|
protected $secure_actions = array(
|
2011-10-14 05:44:12 +00:00
|
|
|
'add'=>TRUE,
|
|
|
|
'edit'=>TRUE,
|
2010-11-29 22:41:08 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
2011-10-14 05:44:12 +00:00
|
|
|
* Add Export Maping items
|
2010-11-29 22:41:08 +00:00
|
|
|
*/
|
2011-10-14 05:44:12 +00:00
|
|
|
public function action_add() {
|
|
|
|
$eo = ORM::factory('export');
|
|
|
|
$output = '';
|
2010-11-29 22:41:08 +00:00
|
|
|
|
2011-10-14 05:44:12 +00:00
|
|
|
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)));
|
2010-11-29 22:41:08 +00:00
|
|
|
|
|
|
|
SystemMessage::add(array(
|
2011-10-14 05:44:12 +00:00
|
|
|
'title'=>_('Record add'),
|
2010-11-29 22:41:08 +00:00
|
|
|
'type'=>'info',
|
2011-10-14 05:44:12 +00:00
|
|
|
'body'=>_('Export Map entry added.')
|
2010-11-29 22:41:08 +00:00
|
|
|
));
|
|
|
|
}
|
2011-10-14 05:44:12 +00:00
|
|
|
|
|
|
|
$output .= Form::open();
|
|
|
|
$output .= View::factory('export/admin/map/add')
|
|
|
|
->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() {
|
2010-11-29 22:41:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|