Forums / Developer / Feedback form and file upload

Feedback form and file upload

Author Message

Salvatore Guarino

Monday 07 November 2005 8:33:14 am

I want to edit the standard feedback-form class adding a field to allow user to upload a file from the front-end interface. There is a simply way to do it? If I add a "file" field in the class, the checkbox "collect information" is disabled. There is a simple way to do it?

Thanks,

Salvatore

Łukasz Serwatka

Monday 07 November 2005 1:08:05 pm

Hi Salvatore,

Look at
http://ez.no/community/forum/setup_design/how_to_send_a_file_with_a_feedback_form

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Salvatore Guarino

Tuesday 08 November 2005 6:12:47 am

Thank you Luke,

I created a custom class and I used your notification extension.

Bye!

Łukasz Serwatka

Tuesday 08 November 2005 6:41:39 am

Very nice ;) Good to see that is useful for someone ;)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

John Smith

Sunday 10 September 2006 9:01:58 am

hi Guarino,

Could it be possible for you to let me know, how have you created custom class for the file to be uploaded from the user end.

Please help.
Smith

Norman Leutner

Sunday 10 September 2006 9:42:57 am

Hi,
just create a new class named "my form" with at least two attributes <name>,<file>.
Edit the anonymous role and allow the anonymous users to create objects of that class at a specific subtree.

Then create a button like:

    <form method="post" action="/content/action">
                <input class="button" type="submit" name="Feedback" value="Feedback" />
                <input type="hidden" name="RedirectURIAfterPublish" value="/" />
                <input type="hidden" name="ContentNodeID" value="5512" />
                <input type="hidden" name="ContentObjectID" value="5846" />
                <input type="hidden" name="NodeID" value="5512" />
                <input type="hidden" name="ClassIdentifier" value="my_form" />
            </div>
    </form>

Now you can see the standard edit.tpl when you klick on that button.
Then simply create a new overrride edit.tpl template for that class.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

John Smith

Monday 11 September 2006 1:25:13 am

hi leutner,

Thank you very much for your help. Much Appreciated.

One more thing on which i would like some help from you.

What i am trying to achieve is to allow users to register first and after registering, they can upload a file, but each user can only see/edit their own uploaded files.

Another thing, on the administration end, the administrator must be able to know, who has uploaded what. Is their any solution. At the moment all the files which are uploaded by the different users from the user end, are going into same folder and the administrator can't tell who has uploaded what.

Please help

Smith

Norman Leutner

Monday 11 September 2006 2:23:03 am

Hey John,

at first you need to create a new section within the admin panel under /section/list
called "members_only". Then assign this section to the part / subtree of your site which should be only visible for registered users.

Then go to the create a new role under /role/list called "Guest accounts" like:

  content  read  Section( members_only ) , Owner( Self )    
  content  create  Class( my_form ) , Section( members_only )    
  content  edit  Class(  my_form ) , Section( members_only ) , Owner( Self )  

Now assign this role to the "Guest accounts" user group where all standard registered users are placed. All users which want to access the section "members_only" are now asked for their login data.

Reguarding the creator:
If anyone publishes something, the creator is stored. Within the admin panel list view, just click on the "Detailed view" button to show the creator of each object.

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

John Smith

Monday 11 September 2006 4:18:29 am

Thanks Leutner,

The Roles which i have given are given below:

content  read  Section( Members Only ) , Owner( Self )  
content  create  Class( My Form ) , Section( Members Only )  
content  edit  Class( My Form ) , Section( Members Only ) , Owner( Self )  
user  login  SiteAccess( news )  
content  read  Section( Standard , Members Only )

Everything working fine, but the user can see other files as well which are uploaded by other users.

Thanks in advance.

 

Norman Leutner

Monday 11 September 2006 7:03:37 am

Change

content read Section( Standard , Members Only ) 

to:

content read Section( Standard ) 

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Abdul Rehman

Monday 02 October 2006 2:08:18 am

Hey Leutner,
Regrading this post, I want to know that should the form "my_form" attributes will be declared as informatin collector ? In addition to this, I want to to send the newly created object information say 'feedback' to two different e-mail addresses.
Plz, guide me regarding this, and I am also new to ez publish.

Thanks.

JC Jee

Thursday 15 March 2007 8:52:14 pm

Hi Everyone,

I have tried following the examples here, and also tried searching through the threads, but I am still unable to get the default edit page to show. Can anyone kindly provide a step-by-step instructions for this newbie here to get the page to work?

I have created the following:
- feedback class "my_feedback", ID 29
- "myfolder", under the eZ publish content structure, Node ID 470, section "Feedback"
- assigned the rights to user "Anonymous":
content create Class( my_feedback ) , Section( Feedback )
content edit Class( my_feedback ) , Section( Feedback ) , Owner( Self )
content read Section( Feedback )

<form method="post" action="/myweb/index.php/web/content/action">
<input class="button" type="submit" name="Feedback" value="Feedback" />
<input type="hidden" name="ContentNodeID" value="470" />
<input type="hidden" name="ContentObjectID" value="29" />
<input type="hidden" name="NodeID" value="470" />
<input type="hidden" name="ClassIdentifier" value="my_feedback" />
</form>

I tried using the above form, but I get a blank page, except for the headers and footer specified in the base template. If I submit the form by specifying ClassIdentifier and NodeID, I get "Object Not Found". Can anyone enlighten me what went wrong?

Stéphane Bullier

Friday 16 March 2007 2:53:03 am

Hello,

To created content into frontoffice :

First I created a button :
<form method="post" action="/content/action">
<input type="hidden" name="ClassID" value="<class_id>" />
<input type="hidden" name="ContentLanguageCode" value="<fre-FR>" />
<input type="hidden" name="ContentObjectLanguageCode" value="<fre-FR>" />
<input type="hidden" name="ContentObjectID" value="{$content_object.id}" />
<input type="hidden" name="NodeID" value="{$current_node.node_id}" />
<input type="hidden" name="ContentNodeID" value="{$current_node.node_id}" />
<input class="button" type="submit" name="NewButton" value="<CreateNewContent>" />
</form>

Chang all text in <>.

After clic on button, you redirected :

<form enctype="multipart/form-data" method="post" action={concat("/content/edit/",$object.id,"/",$edit_version,"/",$edit_language|not|choose(concat($edit_language,"/"),''))|ezurl}>
{def $attributes=$content_attributes}
{foreach $attributes as $attribute}
<p>{$attribute.contentclass_attribute.name} : {attribute_edit_gui attribute=$attribute}</p>
{/foreach}
<input class="defaultbutton" type="submit" name="PublishButton" value="Envoyer pour publication" />
<input class="button" type="submit" name="DiscardButton" value="Abondonner" />
</form>

I you like to know how I can redirect the post of new content with
<input type="hidden" name="RedirectURIAfterPublish" value="<which_value??>" />
on page on "Thank you for your post".

Stéphane

eZ debug

Timing: Jan 18 2025 22:38:46
Script start
Timing: Jan 18 2025 22:38:46
Module start 'content'
Timing: Jan 18 2025 22:38:47
Module end 'content'
Timing: Jan 18 2025 22:38:47
Script end

Main resources:

Total runtime1.0889 sec
Peak memory usage4,096.0000 KB
Database Queries234

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0101 589.1406180.8359
Module start 'content' 0.01010.9295 769.9766882.0391
Module end 'content' 0.93950.1493 1,652.0156357.3125
Script end 1.0888  2,009.3281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3909210.0002
Check MTime0.00150.1419210.0001
Mysql Total
Database connection0.00180.161410.0018
Mysqli_queries0.954387.63322340.0041
Looping result0.00300.27922320.0000
Template Total1.046996.120.5234
Template load0.00210.192720.0010
Template processing1.044895.944220.5224
Template load and register function0.00020.014210.0002
states
state_id_array0.00220.202010.0022
state_identifier_array0.00090.086620.0005
Override
Cache load0.00210.19111150.0000
Sytem overhead
Fetch class attribute can translate value0.00160.151480.0002
Fetch class attribute name0.00120.1077170.0001
XML
Image XML parsing0.00310.282880.0004
class_abstraction
Instantiating content class attribute0.00000.0039210.0000
General
dbfile0.00380.3469490.0001
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
13content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
26content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
12content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 66
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs