Index: branches/5.2.x/units/products/products_config.php =================================================================== diff -u -N -r13845 -r14089 --- branches/5.2.x/units/products/products_config.php (.../products_config.php) (revision 13845) +++ branches/5.2.x/units/products/products_config.php (.../products_config.php) (revision 14089) @@ -1,6 +1,6 @@ Array ( - 'Groups' => Array ( - Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_pending', 'show_disabled'), 'type' => WHERE_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_tang', 'show_sub', 'show_serv', 'show_download', 'show_package'), 'type' => WHERE_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_hot'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_pop'), 'type' => HAVING_FILTER), - Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array ( - 'show_active' => Array ('label' => 'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array ('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array (), - 'show_tang' => Array ('label' => 'la_product_tangible', 'on_sql' => '', 'off_sql' => '%1$s.Type != 1' ), - 'show_sub' => Array ('label' => 'la_product_subscription', 'on_sql' => '', 'off_sql' => '%1$s.Type != 2' ), - 'show_serv' => Array ('label' => 'la_product_service', 'on_sql' => '', 'off_sql' => '%1$s.Type != 3' ), - 'show_download' => Array ('label' => 'la_product_downloadable', 'on_sql' => '', 'off_sql' => '%1$s.Type != 4' ), - 'show_package' => Array ('label' => 'la_product_package', 'on_sql' => '', 'off_sql' => '%1$s.Type != 5' ), - 's2' => Array (), - 'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array ('label' => 'la_Text_TopSellers', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array ('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), + 'Groups' => Array ( + Array ('mode' => 'AND', 'filters' => Array ('show_new'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_hot'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_pop'), 'type' => HAVING_FILTER), + Array ('mode' => 'AND', 'filters' => Array ('show_pick'), 'type' => WHERE_FILTER), + ), + 'Filters' => Array ( + 'show_new' => Array ('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), + 'show_hot' => Array ('label' => 'la_Text_TopSellers', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), + 'show_pop' => Array ('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), + 'show_pick' => Array ('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), + ) + ), - 'TableName' => TABLE_PREFIX.'Products', + 'TableName' => TABLE_PREFIX . 'Products', + 'CalculatedFields' => Array ( '' => Array ( 'AltName' => 'img.AltName', @@ -503,9 +492,9 @@ 'Expire' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' =>null), 'Type' => Array ('type' => 'int', 'not_null' => 1, 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' =>Array (1=> 'la_product_tangible', 2=> 'la_product_subscription', 4=> 'la_product_downloadable', 3=> 'la_product_service'/*, 6=> 'la_gift_certificate', 5=> 'la_product_package'*/), 'not_null' => 1, 'default' => 1 ), 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'ModifiedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CreatedById' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array ('type' => 'int', 'default' => 0), + 'ModifiedById' => Array ('type' => 'int', 'default' => NULL), + 'CreatedById' => Array ('type' => 'int', 'required' => 1, 'default' => NULL), + 'ResourceId' => Array ('type' => 'int', 'default' => null), 'CachedReviewsQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), 'InventoryStatus' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Disabled', 1 => 'la_by_product', 2 => 'la_by_options'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), 'QtyInStock' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), @@ -550,13 +539,15 @@ ), 'VirtualFields' => Array ( - 'Qty' => 1, + 'Qty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'regexp' => '/^[\d]+$/', 'default' => 0), 'Price' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), 'Cost' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => NULL), - 'IsHot' => Array ('type' => 'int'), - 'IsNew' => Array ('type' => 'int'), - 'IsPop' => Array ('type' => 'int'), - 'Manufacturer' => Array (), + 'CategoryFilename' => Array ('type' => 'string', 'default' => ''), + 'PrimaryCat' => Array ('type' => 'int', 'default' => 0), + 'IsHot' => Array ('type' => 'int', 'default' => 0), + 'IsNew' => Array ('type' => 'int', 'default' => 0), + 'IsPop' => Array ('type' => 'int', 'default' => 0), + 'Manufacturer' => Array ('type' => 'string', 'default' => ''), // export related fields: begin 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0), @@ -570,24 +561,24 @@ 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, + 'use_phrases' => 1, 'default' => 1, ), - 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), - 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ()), + 'ExportColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), + 'AvailableColumns' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => ''), 'CategoryFormat' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1), 'CategorySeparator' => Array ('type' => 'string', 'default' => ':'), 'IsBaseCategory' => Array ( 'type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), - 'use_phrases' => 1, 'not_null' => 1, 'default' => 0, + 'use_phrases' => 1, 'default' => 0, ), // export related fields: end // import related fields: begin 'FieldTitles' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Automatic', 2 => 'la_Manual'), 'use_phrases' => 1, 'default' => 1), 'ImportSource' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Upload', 2 => 'la_Local'), 'use_phrases' => 1, 'default' => 2), - 'ImportFilename' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => EXPORT_BASE_PATH . '/'), + 'ImportFilename' => Array ('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => EXPORT_BASE_PATH . '/', 'default' => ''), 'ImportLocalFilename' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), 'CheckDuplicatesMethod' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_IDField', 2 => 'la_OtherFields'), 'use_phrases' => 1, 'default' => 1), 'ReplaceDuplicates' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), @@ -599,13 +590,13 @@ 'FullImage' => Array ('type' => 'string', 'default' => ''), 'ImageAlt' => Array ('type' => 'string', 'default' => ''), - 'Filename' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''), + 'Filename' => Array ('type' => 'string', 'default' => ''), 'CachedNavbar' => Array ('type' => 'string', 'default' => ''), 'ParentPath' => Array ('type' => 'string', 'default' => ''), - 'FileSize' => Array ('type' => 'int', 'formatter' => 'kFilesizeFormatter', 'not_null' => 1, 'default' => 0), - 'FilePath' => Array (), - 'FileVersion' => Array (), + 'FileSize' => Array ('type' => 'int', 'formatter' => 'kFilesizeFormatter', 'default' => 0), + 'FilePath' => Array ('type' => 'string', 'default' => ''), + 'FileVersion' => Array ('type' => 'string', 'default' => ''), // for primary image 'AltName' => Array ('type' => 'string', 'default' => ''),