General improvements

This commit is contained in:
Deon George
2015-06-04 14:25:58 +10:00
parent 9359564ea8
commit c88d289e82
4 changed files with 40 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Mark all accounts that have no outstanding invoices and active services as disabled.
* Import photo to the database
*
* @package Photo
* @category Tasks
@@ -10,6 +10,10 @@
* @license http://dev.leenooks.net/license.html
*/
class Task_Photo_Import extends Minion_Task {
private $_accepted = array(
'jpg',
);
protected $_options = array(
'file'=>NULL, // Photo File to Import
'verbose'=>FALSE, // Photo File to Import
@@ -22,10 +26,13 @@ class Task_Photo_Import extends Minion_Task {
if (preg_match('/@__thumb/',$params['file']) OR preg_match('/\/._/',$params['file']))
return sprintf("Ignoring file [%s]\n",$params['file']);
if (! in_array(strtolower(pathinfo($params['file'],PATHINFO_EXTENSION)),$this->_accepted))
return sprintf("Ignoring file [%s]\n",$params['file']);
$po = ORM::factory('Photo',array('filename'=>$params['file']));
if (! $po->loaded())
$po->filename = $params['file'];
$po->filename = realpath($params['file']);
$po->date_taken = $this->dbcol(strtotime($po->io('exif:DateTime')));
$po->signature = $this->dbcol($po->io()->getImageSignature());

View File

@@ -21,7 +21,6 @@ class Task_Photo_Move extends Minion_Task {
} else {
$p = ORM::factory('Photo')
->where('date_taken','is not',NULL)
->where_open()
->where('remove','!=',TRUE)
->or_where('remove','is',NULL)