Page MenuHomeIn-Portal Phabricator

custom
No OneTemporary

File Metadata

Created
Fri, Jun 20, 5:59 AM
Index: branches/RC/custom/units/test/test_config.php
===================================================================
--- branches/RC/custom/units/test/test_config.php (revision 11654)
+++ branches/RC/custom/units/test/test_config.php (revision 11655)
@@ -1,185 +1,186 @@
<?php
$config = Array(
'Prefix' => 'test',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'TestEventHandler','file'=>'test_eh.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'TestId',
'StatusField' => Array('Status'),
'TableName' => TABLE_PREFIX.'Tests',
/*
'ForeignKey' => 'ParentId', // field title in TableName, linking record to a parent
'ParentTableKey' => 'ParentId', // id (or other key) field title in parent's table
'ParentPrefix' => 'parent',
'AutoDelete' => true, // delete these items when parent is being deleted
'AutoClone' => true, // clone these items when parent is being cloned
*/
'TitlePresets' => Array(
'default' => Array(
'new_status_labels' => Array('test'=>'!la_title_AddingTest!'),
'edit_status_labels' => Array('test'=>'!la_title_EditingTest!'),
),
'test_edit'=>Array(
'prefixes' => Array('test'),
'format' => '#test_status# #test_titlefield#',
),
),
'PermSection' => Array('main' => 'custom:tests'),
// don't forget to add corresponding permissions to install script
// INSERT INTO Permissions VALUES (0, 'custom:custom.view', 11, 1, 1, 0);
// INSERT INTO Permissions VALUES (0, 'custom:tests.view', 11, 1, 1, 0), (0, 'custom:tests.add', 11, 1, 1, 0), (0, 'custom:tests.edit', 11, 1, 1, 0), (0, 'custom:tests.delete', 11, 1, 1, 0);
'Sections' => Array(
'custom:tests' => Array(
'parent' => 'custom',
'icon' => 'custom:tests',
'label' => 'la_tab_Tests',
'url' => Array('t' => 'custom/tests/test_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 1,
'type' => stTREE,
),
),
'TitleField' => 'LastName', // field, used in bluebar when editing existing item
// Use %1$s for local table name with prefix, %2$s for calculated fields
'ListSQLs' => Array( // key - special, value - list select sql
'' => 'SELECT %1$s.* %2$s
FROM %1$s',
),
'ItemSQLs' => Array(
'' => 'SELECT %1$s.* %2$s
FROM %1$s',
),
'ListSortings' => Array(
'' => Array(
// 'ForcedSorting' => Array('Priority' => 'desc'),
'Sorting' => Array('Title' => 'asc'),
)
),
'Fields' => Array(
- 'TestId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
- 'Title' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
- 'Description' => Array('type' => 'string', 'default' => null),
- 'Email' => Array(
- 'type' => 'string', 'formatter'=>'kFormatter',
- 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/',
- 'sample_value' => 'email@domain.com',
- 'not_null' => 1, 'default' => '',
- 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!')
- ),
- 'Type' => array('type' => 'int',
- 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
- 'options'=> array(
- 1=>'la_default_type',
- 2=>'la_some_type',
- 3=>'la_another_type',
- ),
- 'not_null' => 1,
- 'default' => 1,
- 'required' => 1,
- ),
- 'Phone' => Array('type' => 'string','default' => '','not_null' => 1),
- 'Qty' => array('type'=>'double','required'=>0,'not_null' => 1, 'default' => 0),
- 'Status' => Array(
- 'type' => 'int', 'formatter' => 'kOptionsFormatter',
- 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
- 'use_phrases' => 1, 'not_null' => 1, 'default' => 2
- ),
- 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'not_null' => true),
- 'Good' => Array(
- 'type' => 'int', 'formatter' => 'kOptionsFormatter',
- 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
- 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
- ),
- 'BirthTime' => Array(
- 'type' => 'int', 'formatter' => 'kDateFormatter',
- 'date_format' => '', 'input_date_format' => '',
- 'default' => null
- ),
- 'Image' => Array(
- 'type'=>'string', 'formatter'=>'kUploadFormatter',
- 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
- 'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
+ 'TestId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Title' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
+ 'Description' => Array('type' => 'string', 'default' => null),
+ 'Email' => Array(
+ 'type' => 'string', 'formatter'=>'kFormatter',
+ 'regexp'=>'/^[_a-zA-Z0-9-\.]+@[a-zA-Z0-9-\.]+\.[a-z]{2,4}$/',
+ 'sample_value' => 'email@domain.com',
+ 'not_null' => 1, 'default' => '',
+ 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!')
+ ),
+ 'Type' => array('type' => 'int',
+ 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
+ 'options'=> array(
+ 1=>'la_default_type',
+ 2=>'la_some_type',
+ 3=>'la_another_type',
+ ),
+ 'not_null' => 1,
+ 'default' => 1,
+ 'required' => 1,
+ ),
+ 'Phone' => Array('type' => 'string','default' => '','not_null' => 1),
+ 'Qty' => array('type'=>'double','required'=>0,'not_null' => 1, 'default' => 0),
+ 'Status' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 2
+ ),
+ 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'time_format' => '', 'input_time_format' => '', 'default'=>'#NOW#', 'not_null' => true),
+ 'Good' => Array(
+ 'type' => 'int', 'formatter' => 'kOptionsFormatter',
+ 'options' => Array(1 => 'la_Yes', 0 => 'la_No'),
+ 'use_phrases' => 1, 'not_null' => 1, 'default' => 0
+ ),
+ 'BirthTime' => Array(
+ 'type' => 'int', 'formatter' => 'kDateFormatter',
+ 'date_format' => '', 'input_date_format' => '',
+ 'default' => null
+ ),
+ 'Image' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.jpg;*.gif;*.png', 'files_description'=>'!la_ImageFiles!',
'upload_dir'=>'/system/user_files/', // relative to project's home
'as_image'=>true, 'thumb_width'=>100, 'thumb_height'=>100,
'multiple'=>false, // false or max number of files - will be stored as serialized array of paths
'direct_links'=>false, // use direct file urls or send files through wrapper (requires mod_mime_magic)
- 'required' => 1,
- ),
- 'DataFile' => Array(
- 'type'=>'string', 'formatter'=>'kUploadFormatter',
- 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
- 'file_types'=>'*.*',
- 'files_description'=>'!la_AllFiles!',
+ 'required' => 1, 'default' => null
+ ),
+ 'DataFile' => Array(
+ 'type'=>'string', 'formatter'=>'kUploadFormatter',
+ 'max_size'=>MAX_UPLOAD_SIZE, // in Bytes !
+ 'file_types'=>'*.*',
+ 'files_description'=>'!la_AllFiles!',
'upload_dir'=>'/system/user_files/', // relative to project's home
'as_image'=>false,
'multiple'=>5, // false or max number of files - will be stored as serialized array of paths
'direct_links'=>true, // use direct file urls or send files through wrapper (requires mod_mime_magic)
- ),
+ 'default' => null
+ ),
),
'Grids' => Array(
'Default' => Array(
// 'Icons' => Array('default'=>'icon16_custom.gif'),
'Fields' => Array(
'TestId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'width'=>50 ),
'Title' => Array( 'title'=>'la_col_TestName', 'width'=>100),
'Image' => Array ('title' => 'la_col_Image', 'data_block' => 'grid_image_td'),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
'Status' => Array( 'title'=>'la_col_Status', 'filter_block' => 'grid_options_filter'),
'Good' => Array( 'title'=>'la_col_Good'),
'Qty' => Array( 'title'=>'la_col_Qty', 'header_block' => 'grid_column_title_no_sorting', 'filter_block' => 'grid_float_range_filter'),
'Email' => Array( 'title'=>'la_col_Email', 'width'=>70),
'Phone' => Array( 'title'=>'la_col_Phone', 'width'=>80),
'CreatedOn' => Array( 'title'=>'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width'=>110),
'Description' => Array('title' => 'la_col_Description', 'width'=>150),
//'BirthTime' => Array ('title' => 'la_col_BirthTime', 'filter_block' => 'grid_date_range_filter'),
),
),
),
'ConfigMapping' => Array(
'PerPage' => 'Comm_Perpage_Tests',
'ShortListPerPage' => 'Comm_Perpage_Tests_Short',
),
);
/*
Don't forget to:
- Add table create statement to install_schema.sql
CREATE TABLE Tests (
`TestId` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Title` VARCHAR( 255 ) NOT NULL ,
`Description` TEXT NULL ,
`Email` VARCHAR( 255 ) NOT NULL ,
`Type` TINYINT NOT NULL ,
`Phone` VARCHAR( 50 ) NOT NULL ,
`Qty` DOUBLE NOT NULL ,
`Status` TINYINT NOT NULL ,
`CreatedOn` INT NOT NULL ,
`Good` TINYINT NOT NULL
)
- Add permissions for admin gorup to install script (see 'Sections' key above)
*/
\ No newline at end of file
Property changes on: branches/RC/custom/units/test/test_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8.2.8
\ No newline at end of property
+1.8.2.9
\ No newline at end of property
Index: branches/RC/custom/units/sections/sections_config.php
===================================================================
--- branches/RC/custom/units/sections/sections_config.php (revision 11654)
+++ branches/RC/custom/units/sections/sections_config.php (revision 11655)
@@ -1,52 +1,52 @@
<?php
// INSERT INTO `inp_Modules` VALUES ('Custom', 'custom/', 'custom-sections', '5.0.0', 1, 3, 'custom/', 0, 0);
$config = Array (
'Prefix' => 'custom-sections',
'ConfigPriority' => 2,
'EventHandlerClass' => Array ('class' => 'CustomEventHandler', 'file' => 'custom_eh.php', 'build_event' => 'OnBuild'), // for OnAfterConfigRead event
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), // for tree drawing
'RegisterClasses' => Array (
// Array ('pseudo' => 'c_TagProcessor', 'class' => 'ECategoriesTagProcessor', 'file' => 'categories_tp.php'),
// Array ('pseudo' => 'u_EventHandler', 'class' => 'EUsersEventHandler', 'file' => 'users_event_handler.php'),
),
// 'ReplacementTemplates' => Array (
// 'incs/image_blocks' => 'custom/incs/image_blocks',
// 'in-news/articles/articles_edit' => 'custom/articles/articles_edit',
// 'categories/categories_edit' => 'custom/categories/categories_edit',
// ),
/*'Hooks' => Array (
Array (
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'c',
'HookToSpecial' => '*',
'HookToEvent' => Array ('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '*',
'DoEvent' => 'OnModifyCategoriesConfig',
),
),*/
- 'PermSection' => Array ('main' => 'custom',),
+ 'PermSection' => Array ('main' => 'custom', 'email' => 'custom:configuration_email'),
'Sections' => Array (
'custom' => Array (
'parent' => 'in-portal:root',
'icon' => 'custom',
'label' => 'la_title_In-Custom',
'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
'permissions' => Array ('view'),
'priority' => 2.4,
'container' => true,
'type' => stTREE,
),
),
);
\ No newline at end of file
Property changes on: branches/RC/custom/units/sections/sections_config.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.3
\ No newline at end of property
+1.1.2.4
\ No newline at end of property
Index: branches/RC/custom/install/upgrades.sql
===================================================================
--- branches/RC/custom/install/upgrades.sql (revision 11654)
+++ branches/RC/custom/install/upgrades.sql (revision 11655)
@@ -1,10 +1,12 @@
# ===== v 4.1.0 =====
ALTER TABLE Tests ADD `Image` VARCHAR( 255 ) NULL ;
ALTER TABLE Tests ADD `DataFile` VARCHAR( 255 ) NULL ;
# ===== v 5.0.0 =====
INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.view', 11, 1, 1, 0);
+
+UPDATE Modules SET Var = 'custom-sections' WHERE Name = 'Custom';
\ No newline at end of file
Property changes on: branches/RC/custom/install/upgrades.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.4.1
\ No newline at end of property
+1.1.4.2
\ No newline at end of property
Index: branches/RC/custom/install/install_data.sql
===================================================================
--- branches/RC/custom/install/install_data.sql (revision 11654)
+++ branches/RC/custom/install/install_data.sql (revision 11655)
@@ -1,17 +1,17 @@
# place here only sql queries, that were executed on live AND dev sites !!!
INSERT INTO Permissions VALUES(DEFAULT, 'custom.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.delete', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.edit', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.add', 11, 1, 1, 0);
INSERT INTO Permissions VALUES(DEFAULT, 'custom:tests.view', 11, 1, 1, 0);
-INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('Custom', 'custom/', 'custom', '0.0.0', 1, 2, '', 0, '0');
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('Custom', 'custom/', 'custom-sections', '0.0.0', 1, 2, '', 0, '0');
# ===== SQLs above this line already on LIVE ================================================================================================
# place here only sql queries, that were executed on dev site !!!
# ===== SQLs above this line already on DEV ========================================================================================================
# place here only sql queries, that were executed on prod server !!!
Property changes on: branches/RC/custom/install/install_data.sql
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.2.2.2
\ No newline at end of property
+1.2.2.3
\ No newline at end of property

Event Timeline