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

61 lines
1.5 KiB
PHP
Raw Normal View History

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(
'add'=>TRUE,
'edit'=>TRUE,
2010-11-29 22:41:08 +00:00
);
/**
* Add Export Maping items
2010-11-29 22:41:08 +00:00
*/
public function action_add() {
2012-11-09 23:13:57 +00:00
$eo = ORM::factory('Export');
$output = '';
2010-11-29 22:41:08 +00:00
if ($_POST AND $eo->values($_POST)->check()) {
2012-11-09 23:13:57 +00:00
$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(
'title'=>_('Record add'),
2010-11-29 22:41:08 +00:00
'type'=>'info',
'body'=>_('Export Map entry added.')
2010-11-29 22:41:08 +00:00
));
}
$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() {
2010-11-29 22:41:08 +00:00
}
}
?>