block lock

In the edit block section if there was a simple checkbox for “Lock Block” that removed the red x from it on the main page that would be great.

We are a fair sized e-commerce company with about 20 people and we are hiring people and training them all the time. If someone didn’t realize and accidentally removed a product block, it would destroy hundreds of hours of work of custom product info.



Perhaps it could also prevent the block from being moved around. I found that sometimes when clicking a block the page seems to jump to the top moving the block with it.

I suggest that you create administrator accounts with limited accessibility to the blocks functionality.



ensure knowledgeable people have higher-end accounts based upon their role in the company.



regardless I agree with you, but can’t find any technical feasible functionality easily programmed.

That might work for a small shop with a couple hundred products. But we have 10’s of thousands of products and many people we train to maintain them. They need to be able to add product and select the related products. Even if we don’t give them access to the design block page, under the product block page, it is still deletable. Adding products is grunt work. For a large company it needs to be feasible for non-technical people to be easily trained and unable to screw-up more than the product they are adding. Without the ability to lock the block, they have the potential to break the entire site right there, on a page they have to click through every day. They can always be fired, but that will still leave us screwed.





If a new field was added to the blocks table, wouldn’t that be available when generating the x button? If ( ! $block[locked]) { draw x }? Making it non dragable might be more difficult though.

Block Lock:

removes x and stops drag. Could use a little CSS touchup, but it works just fine.



Design Blocks Page:



/admin/view/block_manager/components/block_element.tpl

there is a {strip} starting on line 7, change the content inside it to this:


{strip}
{if !$block_data.properties.locked_block}
{assign var="drag_handle" value="h4"}
{else}
{assign var="drag_handle" value="h3"}
{/if}
<{$drag_handle}>
{if ($location == "all_pages" || $block_data.location != "all_pages") && !$block_data.properties.static_block && !$block_data.properties.locked_block}
{$lang.delete}
{/if}
{assign var="block_content_id" value="block_content_`$block_data.block_id`"}
{if !$block_data.properties.static_block}

{/if}
{$block_data.block}

{/strip}






Then:

/admin/view/block_manager/update.tpl

Add this after line 105, right before the hook:












Products Block Page:

/admin/view/products/components/products_tabs_element.tpl

replace the {strip} contents with the following same as block_element.tpl


{strip}
{if !$block_data.properties.locked_block}
{assign var="drag_handle" value="h4"}
{else}
{assign var="drag_handle" value="h3"}
{/if}
<{$drag_handle}>
{if $block_data.location == "products" && !$block_data.properties.locked_block}
{$lang.delete}
{/if}
{assign var="block_content_id" value="block_content_`$block_data.block_id`"}
{if $block_data.location == "products"}

{/if}
{$block_data.block}

{/strip}









The system will automatically create the new propery locked_block.

You also need to add “locked_block” to the languages and change some of the h3 css.



Changing the isotrables handle was the easiest way to stop it from dragging. If the handle wasn’t a tag and was a class, it would make more sense and wouldn’t screw with the css.



This was pretty small mod.





EDIT: The reason for switching it from h3 to h4 is because “h3” is set as the handle for dragging in the JS code. It was a poor choice. Would have made more sense to use a class, but the programmers seem to be bias to using classes as they are fairly uncommon throughout the cart (stab stab).

If they switch it to a class, then the tag could stay the same and the styling wouldn’t need to change.

You can vote to have this feature added to the standard cart in the Ideas forum:

[url]http://cscart.uservoice.com/forums/40782-general/suggestions/703308-add-the-ability-to-lock-a-block[/url]



Bob

We are kind of having the same issue…would be nice if you could assign to specific user accounts, the ability to disable the delete function all together over the entire backend or specific areas of the backend.



Stu