Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Period.php
1 <?php
2
3 /**
4  * -- Create Period
5  * 
6  *
7  */
8 require_once 'Pman.php';
9  
10 class Pman_Xtuple_Period extends Pman
11 {
12     static $cli_desc = "Create Period";
13     
14     static $cli_opts = array(
15         'create' => array(
16             'desc' => 'which year you want to create',
17             'short' => 'c',
18             'default' => '',
19             'min' => 1,
20             'max' => 1,
21             
22         )
23     );
24     
25     function getAuth() {
26         
27         
28         $ff = HTML_FlexyFramework::get();
29         if (!empty($ff->cli)) {
30             $this->cli = true;
31             return true;
32         }
33         die("NOT ALLOWED");
34     }
35     
36     function get($args, $opts)
37     {
38         if(!empty($opts['create'])){
39             $period = DB_DataObject::factory('period');
40             $period->createPeriod($opts['create']);
41             die("DONE!");
42         }
43         
44         die("Nothing to do, Missing parameters! \n");
45     }
46     
47   
48     
49     
50 }