Updates from lnApp

This commit is contained in:
Deon George
2011-07-14 08:59:32 +10:00
parent 5c9750e957
commit 46c3b9a075
31 changed files with 991 additions and 434 deletions

View File

@@ -276,18 +276,16 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
// Process upload
// @todo This should be separated out by supplier in case each supplier has a different format
$files = Validate::factory($_FILES);
$files->rules('csv',array(
'Upload::valid'=>array(),
'Upload::not_empty'=>array(),
'Upload::type'=>array('Upload::type' => array('csv')),
'Upload::size'=>array('10M'))
);
if ($_FILES) {
$files = Validation::factory($_FILES)
->rule('csv','Upload::valid')
->rule('csv','Upload::not_empty')
->rule('csv','Upload::type',array(':value',array('csv')))
->rule('csv','Upload::size',array(':value','10M'));
if ($files->check()) {
foreach ($files as $file) {
$csv = $this->process($file);
}
if ($files->check())
foreach ($files as $file)
$csv = $this->process($file);
}
// @todo add a display if there are no items

View File

@@ -17,7 +17,7 @@ class Model_Service extends ORMOSB {
'adsl_plan'=>array('through'=>'service__adsl'),
);
protected $_has_one = array(
'service_adsl'=>array(),
'service_adsl'=>array('far_key'=>'id'),
);
protected $_belongs_to = array(
'product'=>array(),