Fix deprecation warnings for master

This commit is contained in:
Stephen Shkardoon 2013-08-22 23:38:26 +12:00
parent c4586c7404
commit aa190ea7a5
5 changed files with 26 additions and 26 deletions

View File

@ -1,6 +1,7 @@
<?php
DMSDocument_versions::$enable_versions = true;
$config = Config::inst();
$config->update('DMSDocument_versions', 'enable_versions', true);
DMSSiteTreeExtension::show_documents_tab(); //show the Documents tab on all pages
DMSSiteTreeExtension::no_documents_tab(); //and don't exclude it from any pages
@ -8,15 +9,14 @@ DMSDocumentAddController::add_allowed_extensions(); //add an array of additional
define('DMS_DIR', 'dms');
if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . DMS_DIR)) user_error("DMS directory named incorrectly. Please install the DMS module into a folder named: ".DMS_DIR);
CMSMenu::remove_menu_item('DMSDocumentAddController');
ShortcodeParser::get('default')->register('dms_document_link', array('DMSDocument_Controller', 'dms_link_shortcode_handler'));
if (DMSDocument_versions::$enable_versions) {
if ($config->get('DMSDocument_versions', 'enable_versions')) {
//using the same db relations for the versioned documents, as for the actual documents
Config::inst()->update('DMSDocument_versions', 'db', DMSDocument::$db);
$config->update('DMSDocument_versions', 'db', $config->get('DMSDocument', 'db'));
}

View File

@ -1,6 +1,6 @@
<?php
class DMSDocument extends DataObject implements DMSDocumentInterface {
static $db = array(
private static $db = array(
"Filename" => "Varchar(255)", // eg. 3469~2011-energysaving-report.pdf
"Folder" => "Varchar(255)", // eg. 0
"Title" => 'Varchar(1024)', // eg. "Energy Saving Report for Year 2011, New Zealand LandCorp"
@ -14,27 +14,27 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
"ExpireAtDate" => 'SS_DateTime'
);
static $many_many = array(
private static $many_many = array(
'Pages' => 'SiteTree',
'Tags' => 'DMSTag'
);
static $many_many_extraFields = array(
private static $many_many_extraFields = array(
'Pages' => array(
'DocumentSort' => 'Int'
),
);
static $display_fields = array(
private static $display_fields = array(
'ID'=>'ID',
'Title'=>'Title',
'FilenameWithoutID'=>'Filename',
'LastChanged'=>'LastChanged'
);
static $singular_name = 'Document';
private static $singular_name = 'Document';
static $plural_name = 'Documents';
private static $plural_name = 'Documents';
public function canView($member = null) {

View File

@ -6,37 +6,37 @@
*/
class DMSDocument_versions extends DataObject {
static $enable_versions = true; //flag that turns on or off versions of documents when replacing them
public static $enable_versions = true; //flag that turns on or off versions of documents when replacing them
static $db = array(
private static $db = array(
'VersionCounter' => 'Int',
'VersionViewCount' => 'Int'
); //config system call in _config creates this to mirror DMSDocument
static $has_one = array(
private static $has_one = array(
'Document' => 'DMSDocument' //ID of the original DMSDocument object this is a version of
);
static $defaults = array(
private static $defaults = array(
'VersionCounter' => 0
);
static $display_fields = array(
private static $display_fields = array(
'VersionCounter' => 'Version Counter',
'FilenameWithoutID' => 'Filename',
'LastChanged' => 'Last Changed'
);
static $summary_fields = array(
private static $summary_fields = array(
'VersionCounter',
'FilenameWithoutID'
);
static $field_labels = array(
private static $field_labels = array(
'FilenameWithoutID'=>'Filename'
);
static $default_sort = array(
private static $default_sort = array(
'LastChanged' => 'DESC'
);
@ -210,4 +210,4 @@ class DMSDocument_versions extends DataObject {
}
?>
?>

View File

@ -1,12 +1,12 @@
<?php
class DMSSiteTreeExtension extends DataExtension {
static $belongs_many_many = array(
private static $belongs_many_many = array(
'Documents' => 'DMSDocument'
);
static $noDocumentsList = array();
static $showDocumentsList = array();
private static $noDocumentsList = array();
private static $showDocumentsList = array();
/**
* Do not show the documents tab on the array of pages set here
@ -153,4 +153,4 @@ class DMSSiteTreeExtension extends DataExtension {
function getTitleWithNumberOfDocuments() {
return $this->owner->Title . ' (' . $this->owner->Documents()->Count() . ')';
}
}
}

View File

@ -4,13 +4,13 @@
*/
class DMSTag extends DataObject {
static $db = array(
private static $db = array(
'Category' => 'Varchar(1024)',
'Value' => 'Varchar(1024)',
'MultiValue' => 'Boolean(1)'
);
static $belongs_many_many = array(
private static $belongs_many_many = array(
'Documents' => 'DMSDocument'
);
}
}