Index: branches/5.2.x/core/units/logs/change_logs/change_log_eh.php
===================================================================
diff -u -N -r14244 -r14639
--- branches/5.2.x/core/units/logs/change_logs/change_log_eh.php (.../change_log_eh.php) (revision 14244)
+++ branches/5.2.x/core/units/logs/change_logs/change_log_eh.php (.../change_log_eh.php) (revision 14639)
@@ -1,22 +1,61 @@
getObject();
- /* @var $object kDBItem */
+ /**
+ * Allows to override standard permission mapping
+ *
+ */
+ function mapPermissions()
+ {
+ parent::mapPermissions();
- $sql = 'UPDATE ' . $this->Application->getUnitOption('session-log', 'TableName') . '
- SET AffectedItems = AffectedItems - 1
- WHERE SessionLogId = ' . $object->GetDBField('SessionLogId');
- $this->Conn->Query($sql);
- }
- }
\ No newline at end of file
+ $permissions = Array (
+ 'OnEnableLog' => Array ('self' => 'view'),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Updates affected record count in session, when change log record is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ parent::OnAfterItemDelete($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('session-log', 'TableName') . '
+ SET AffectedItems = AffectedItems - 1
+ WHERE SessionLogId = ' . $object->GetDBField('SessionLogId');
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Changes configuration value to enable log writing
+ *
+ * @param kEvent $event
+ */
+ function OnEnableLog(&$event)
+ {
+ $this->Application->SetConfigValue('UseChangeLog', 1);
+ }
+}
\ No newline at end of file
Index: branches/5.2.x/core/units/logs/change_logs/change_log_tp.php
===================================================================
diff -u -N
--- branches/5.2.x/core/units/logs/change_logs/change_log_tp.php (revision 0)
+++ branches/5.2.x/core/units/logs/change_logs/change_log_tp.php (revision 14639)
@@ -0,0 +1,32 @@
+Application->ParseBlock( Array ('name' => $params['link_render_as'], 'strip_nl' => 2) );
+
+ return sprintf( $this->Application->Phrase($params['phrase']), $link_html );
+ }
+}
Index: branches/5.2.x/core/admin_templates/logs/change_logs/change_log_list.tpl
===================================================================
diff -u -N -r14244 -r14639
--- branches/5.2.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 14244)
+++ branches/5.2.x/core/admin_templates/logs/change_logs/change_log_list.tpl (.../change_log_list.tpl) (revision 14639)
@@ -47,6 +47,14 @@
);
a_toolbar.Render();
+
+
+ function enable_log() {
+ if ( confirm('') ) {
+ submit_event('change-log', 'OnEnableLog');
+ }
+ }
+
@@ -88,6 +96,17 @@
+
+
+
+
+
+
+
+
+
+
+