Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Scheduled imports are now linked from import list

  • Loading branch information...
commit 8db07c74f29b499f0d8dcf821ced8b618515a773 1 parent c1bb97b
@lolautruche authored
View
23 classes/sqliimportitem.php
@@ -96,6 +96,11 @@ public static function definition()
'datatype' => 'integer',
'default' => 0,
'required' => true ),
+
+ 'scheduled_id' => array( 'name' => 'scheduled_id',
+ 'datatype' => 'integer',
+ 'default' => null,
+ 'required' => false )
),
'keys' => array( 'id' ),
@@ -109,7 +114,8 @@ public static function definition()
'percentage' => 'getPercentage',
'type_string' => 'getTypeString',
'user_has_access' => 'userHasAccess',
- 'process_time_formated' => 'getFormatedProcessTime' ),
+ 'process_time_formated' => 'getFormatedProcessTime',
+ 'scheduled_import' => 'getScheduledImport' ),
'set_functions' => array( 'options' => 'setOptions',
'user' => 'setUser',
'percentage' => 'setPercentage' )
@@ -433,4 +439,19 @@ public function getFormatedProcessTime()
);
return $aTime;
}
+
+ /**
+ * Returns related scheduled import if it exists, or null if not
+ * @return SQLIScheduledImport
+ */
+ public function getScheduledImport()
+ {
+ $scheduledImport = null;
+ if( $this->attribute( 'scheduled_id' ) )
+ {
+ $scheduledImport = SQLIScheduledImport::fetch( $this->attribute( 'scheduled_id' ) );
+ }
+
+ return $scheduledImport;
+ }
}
View
8 design/admin/templates/sqliimport/list.tpl
@@ -72,7 +72,13 @@
<td>{$import.options|nl2br}</td>
<td>{$import.user.login}</td>
<td>{$import.requested_time|l10n( 'shortdatetime' )}</td>
- <td>{$import.type_string|i18n( 'extension/sqliimport/type' )}</td>
+ <td>
+ {if and( $import.type|eq( 2 ), $import.scheduled_import, $import.user_has_access )}{* 2 = scheduled, sorry for the hardcoded value :-/ *}
+ <a href={concat( 'sqliimport/addscheduled/', $import.scheduled_id )|ezurl}>{$import.type_string|i18n( 'extension/sqliimport/type' )}</a>
+ {else}
+ {$import.type_string|i18n( 'extension/sqliimport/type' )}
+ {/if}
+ </td>
<td>
{$import.status_string|i18n( 'extension/sqliimport/type' )}
{if $import.user_has_access}
View
2  doc/CHANGELOG
@@ -3,6 +3,8 @@
Implemented feature : SIGTERM and SIGINT calls are now caught and import is smoothly and safely interrupted (PCNTL extension needed)
Fixed issue : Scheduled imports - schedule is shifting - http://bit.ly/cJPe5F
Fixed issue : Editing a scheduled import may add empty options - http://bit.ly/bXYAPH
+Scheduled imports are now linked from import list
+
1.1.0
-----------------
View
3  doc/INSTALL.txt
@@ -5,7 +5,8 @@
1. Install *sqlimport* folder in *extension/*
2. Activate the extension in an override of **site.ini**
3. If you are upgrading from 1.0.x, please run the SQL script *update/sql/mysql/1.0-to-1.1.sql*.
- Install the SQL schema (only mysql is currently supported) : *sql/mysql/schema.sql*
+ If your are upgrading from 1.1.x, please run the SQL script *update/sql/mysql/1.1-to-1.2.sql*.
+ Else, just install the SQL schema (only mysql is currently supported) : *sql/mysql/schema.sql*
4. Regenerate autoloads for classes
::
View
4 sql/mysql/schema.sql
@@ -25,8 +25,10 @@ CREATE TABLE `sqliimport_item` (
`type` tinyint(4) DEFAULT '1',
`progression_notes` longtext,
`process_time` int(11) unsigned DEFAULT '0',
+ `scheduled_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `import_item_handler` (`handler`),
KEY `import_item_user` (`user_id`),
- KEY `import_item_status` (`status`)
+ KEY `import_item_status` (`status`),
+ KEY `import_scheduled_id` (`scheduled_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
View
4 update/sql/mysql/1.1-to-1.2.sql
@@ -0,0 +1,4 @@
+-- Add a relation to sqliimport_scheduled when necessary
+ALTER TABLE `sqliimport_item` ADD `scheduled_id` int NULL DEFAULT NULL AFTER `process_time`;
+ALTER TABLE `sqliimport_item` ADD INDEX `import_scheduled_id` (`scheduled_id`);
+
Please sign in to comment.
Something went wrong with that request. Please try again.