10 of 11
10
Standalone Edit Forms
Posted: 15 November 2007 02:50 PM   [ Ignore ]   [ # 163 ]  
Grad Student
Rank
Total Posts:  37
Joined  10-05-2007

I’m using 1.6.0 version EE.  After I entered data through stand-alone entry form, data isn’t populated when I try to edit stand-alone form.  “segment_3” is part of weblog name and “segment_4” is entry_id. 

{exp:weblog:entry_form weblog="{current_weblog}" return="{segment_1}/list/{segment_3}"  preview="{segment_1}/edit/{segment_3}"
  
show_fields="{form_fields}" use_live_url="no"
  
disable="category_fields|member_data|pagination|trackbacks"}

{exp
:weblog:entries weblog="{current_weblog}" rdf="off" limit="1" entry_id="{segment_4}" status="Under Review|Approved|Disapproved|Open|Closed"}

<div><input type="hidden" name="entry_id" value="{segment_4}"></div>

  <
table border='0'  cellspacing='0' cellpadding='0' style='width:97%;' >
    <
tr>
      <
td valign="middle"><h2>Edit {exp:php_text_format type="ucwords"}{segment_3}{/exp:php_text_format}</h2>
      </
td>
      <
td style="width:350px;" valign="top">
        <
div class='submitBox' >
         <
input name='preview' type='submit' class='submit' value='Preview'  />
          &
nbsp;
         <
input name='submit' type='submit' class='submit' value='Update'  />
          &
nbsp;
         <
input name="cancel" type='submit' value="Cancel" onClick="cancelEntry('entry_id{segment_4}');" />
       </
div>
      </
td>
    </
tr>
  </
table>

<
table border='0' cellpadding='0' cellspacing='0' style='width:97%;margin-bottom:3px;' class="tableborder">
  <
tr><td>

  <
div id="content">

{preview}

{display_custom_fields}

{
/preview}

<table border='0' cellpadding='0' cellspacing='0' style='width:100%'>

<
tr>
<
td>

<
div class="hidden">
<
input type="hidden" name="title" id="title" value="{segment_3}" />
<
input type="hidden" name="entry_date" value="{entry_date format='%Y-%m-%d %g:%i %A'}" maxlength="100" style="width:100%;" />
</
div>

{formatting_buttons}

<?php
switch ({segment_3})
{
  
case "article":
  case
"portal":  ?>
<p>
<?php
    
break;
}  ?>

</td>
</
tr>

<
tr>
<
td class="publishRows">
{category_menu}
<b>Program</b>
<
select name="category[]" size="1">
<?php
if ($SESS->cache['custom_profile']['role']!=="Copy Driver") { ?>
  {exp
:form_helper:categories entry_id="{segment_4}" parent_id="0"}
    
<option value="{cat_id}" {selected}>{cat_name}</option>
  
{/exp:form_helper:categories}
<?php
}
else {
  
if ($SESS->cache['custom_profile']['program']==="Aquatics")
    echo
"<option value='18'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Group Fitness")
    echo
"<option value='15'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="General")
    echo
"<option value='22'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Massage")
    echo
"<option value='19'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Membership")
    echo
"<option value='21'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Outdoor Programs")
    echo
"<option value='14'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Personal Traning")
    echo
"<option value='20'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Rec Sports")
    echo
"<option value='16'>".$SESS->cache['custom_profile']['program']."</option>";
  elseif (
$SESS->cache['custom_profile']['program']==="Youth & Family")
    echo
"<option value='17'>".$SESS->cache['custom_profile']['program']."</option>";
}
?>
  
</select>
{/category_menu}
</td>
</
tr>

{custom_fields}

<tr>
<
td class="publishRows">
{if required}<b>* </b>{/if}
<b>{field_label}</b>

{if textarea}
{field_instructions}
<br />
<
textarea id="{field_name}" name="{field_name}" cols="100" rows="{rows}">{field_data}</textarea>
{/if}

{if textinput}
{field_instructions}
<br />
<
input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="100" onclick="setFieldName(this.name)" />
{/if}

{if pulldown}
{field_instructions}
<br />
<
select id="{field_name}" name="{field_name}">
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
</select>
{/if}

{if date}
{field_instructions}
<br />
<
input type="text" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="100" onclick="setFieldName(this.name)" />
{/if}

</td>

{/custom_fields}

</tr>

<
tr>
<
td valign="top">

<
p>
Status
{status_menu}
<select name="status">
<?php
if ($SESS->cache['custom_profile']['role']!=="Copy Driver") { ?>
  {select_options}
<?php
}
else {  ?>
<?php
}
?>
</select>
{/status_menu}
</p>

</
td>
</
tr>
</
table>

  </
td>
  </
tr>
  <
tr>
    <
td>
      <
div class='submitBox' >
        <
input name='preview' type='submit' class='submit' value='Preview'  />
        &
nbsp;
       <
input name='submit' type='submit' class='submit' value='Update'  />
    </
div>
    </
td>
  </
tr>
</
table>

{/exp:weblog:entries}

{
/exp:weblog:entry_form}

Why the fields are populated?

Profile
 
 
Posted: 12 December 2007 09:33 AM   [ Ignore ]   [ # 164 ]  
Grad Student
Rank
Total Posts:  36
Joined  05-23-2007

Hi,

I created a stand alone edit form and it works fine. I gave access to 2 groups one of them being superadmin. When I edit an entry with superadmin, it works fine. But if I use the second group member the entry is saved but it’s status changes to closed. How can I make it stay open?

UPDATE:

I added the following to the edit form:

{status_menu}
<select name="status">
{select_options}
</select>
{/status_menu}

superadmin has both open and close options but the second group only has a closed option.

Update: Found the solution. Needed to assign status group in weblog administration.

Profile
 
 
Posted: 12 December 2007 10:30 AM   [ Ignore ]   [ # 165 ]  
Grad Student
Rank
Total Posts:  36
Joined  05-23-2007

I do have another question smile

I have a consistent header throughout the site, which has a mini news feed which then links to the full news:
{exp:weblog:entries weblog="news" orderby="date" limit="4" }
<li><a href="{path=misc/news}/{absolute_count}">{entry_date format=’%m/%d/%y’} - {title}</a></li>
{/exp:weblog:entries}

But when I go to my stand alone edit form that mini feed disappears. I am using the same header template in all my templates.

Anyone know what could cause this?

Thanks.

Profile
 
 
Posted: 13 December 2007 06:19 PM   [ Ignore ]   [ # 166 ]  
Grad Student
Rank
Total Posts:  36
Joined  05-23-2007

Hi,

I installed the js calendar plugin and it is great. There is one question though. When I edit my entries using SAEFs the calendar is set to current date by default, but I need it to stay as the date chosen when the entry was created, so that I don’t have to revert back to the date I need every time I update the entry?

I would really appreciate your help.

Thanks!

Profile
 
 
Posted: 13 December 2007 07:13 PM   [ Ignore ]   [ # 167 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  738
Joined  07-18-2006
Anton P. - 12 December 2007 10:30 AM

I do have another question smile

I have a consistent header throughout the site, which has a mini news feed which then links to the full news:
{exp:weblog:entries weblog="news" orderby="date" limit="4" }
<li><a href="{path=misc/news}/{absolute_count}">{entry_date format=’%m/%d/%y’} - {title}</a></li>
{/exp:weblog:entries}

But when I go to my stand alone edit form that mini feed disappears. I am using the same header template in all my templates.

Anyone know what could cause this?

Thanks.

This is a random guess but maybe it’s getting confused by your url.  What happens if you put in he parameter dynamic="off".  So:

{exp:weblog:entries weblog="news"  orderby="date"  limit="4" dynamic="off"}
<li><a href="{path=misc/news}/{absolute_count}">{entry_date format='%m/%d/%y'} - {title}</a></li>
{/exp:weblog:entries}

Profile
 
 
Posted: 13 December 2007 07:21 PM   [ Ignore ]   [ # 168 ]  
Grad Student
Rank
Total Posts:  36
Joined  05-23-2007

Thank you Brian! This helped.

Profile
 
 
Posted: 15 January 2008 12:17 PM   [ Ignore ]   [ # 169 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  197
Joined  11-04-2002

I’m experiencing a slightly weird bug on one of my sites. My site is set to let regular members edit their own entries, and Super Admins can edit ALL entries (to change the Status and fix spelling errors, mostly). If a member just edits their own entry, it works fine. But if a Super Admin edits, it reassigns the entry to have the Super Admin as the new author. I need the entries to stay assigned to their original authors, no matter who edits it. The Super Admins make only minor edits, so the entries should not be attributed to them!

I’ve used the stand-alone edit form before on other sites, and didn’t encounter this problem there, so it’s probably something I’m doing wrong - but I can’t figure it out. Does this ring any bells for anyone? Any ideas on how I can make the author “stick”?

 Signature 

erinshore.net | stillburning.com | fever of fate

Profile
 
 
Posted: 21 January 2008 12:22 PM   [ Ignore ]   [ # 170 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  197
Joined  11-04-2002

Bump - anyone? smile

 Signature 

erinshore.net | stillburning.com | fever of fate

Profile
 
 
Posted: 14 May 2008 11:57 AM   [ Ignore ]   [ # 171 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  793
Joined  04-14-2007

Sasha, did you ever find a resolution for this situation - entries being reassigned to a new author when edited by an administrator?

I’m experiencing the same situation.

 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
Posted: 14 May 2008 01:22 PM   [ Ignore ]   [ # 172 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  197
Joined  11-04-2002

Nope, never did get this issue resolved, even with the latest builds.

I was forced to put in place a work-around:
- disable editing by anyone other than the original author
- force anyone who wants to edit someone else’s entry to login to the backend, go to Admin > View Members > Login as Member, and then make the required edit.

Plus I had to go back and re-assign hundreds of entries to the right authors. All in all, this bug has caused me massive headaches and I never did figure out what I was doing wrong. :(

 Signature 

erinshore.net | stillburning.com | fever of fate

Profile
 
 
Posted: 14 May 2008 02:30 PM   [ Ignore ]   [ # 173 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  738
Joined  07-18-2006

You should definitely post this in the bug forum if you haven’t already smile

Profile
 
 
Posted: 11 June 2008 07:02 PM   [ Ignore ]   [ # 174 ]  
Grad Student
Avatar
Rank
Total Posts:  74
Joined  04-12-2008
Anton P. - 13 December 2007 06:19 PM

Hi,

I installed the js calendar plugin and it is great. There is one question though. When I edit my entries using SAEFs the calendar is set to current date by default, but I need it to stay as the date chosen when the entry was created, so that I don’t have to revert back to the date I need every time I update the entry?

I would really appreciate your help.

Thanks!

If I’m understanding you correctly, I’m getting the JS Calendar set correctly with the following:

<input type="text" name="entry_date" value="{entry_date format='%Y-%m-%d %g:%i %A'}" maxlength="23" size="25" class="input" onkeyup="update_calendar('entry_date', this.value);" onclick="setFieldName(this.name)"   />
{exp:cal_saef:calendar name="entry_date"}
   {calendar}
   {clear_link} {today_link}
{
/exp:cal_saef:calendar}

for a custom date field I had to do the following:

<input type="text" id="news_dateUpdate" name={exp:form_helper:field_grabber field_name='news_dateUpdate'}  value="{news_dateUpdate format='%Y-%m-%d %g:%i %A'}"  maxlength="23" size="25" class='input' onkeyup="update_calendar('news_dateUpdate', this.value);" onclick="setFieldName(this.name)"  />
{exp:cal_saef:calendar name="news_dateUpdate"}
   {calendar}
   {clear_link} {today_link}
{
/exp:cal_saef:calendar}

The only issue I’ve ran in using JS Calendar with the Form Helper is if a custom field has a dash (-) in the name, then the Calendar will not render (i.e. the {calendar} portion, rest is fine).  I would think this is an issue with JS Calendar, except if I use the dashed field named in the standard SAEF code in the custom field loop, everything renders just fine.

... and again, I could be missing something, but when I changed the dash to an underscore and udpated templates, the {calendar} portion rendered.  Changing it back to a dash re-produced the results after updating templates.  I did not try variations of the dash location, ‘news-dateUpdate’ is what I had.  I should try newsdate-Update, newsdate- , etc to see if the same occurs.

 Signature 

“You can’t fall off the floor” - Paul’s Law
“Brawndo, It’s what plants crave!” - Idiocracy

Profile
 
 
Posted: 24 June 2008 05:30 PM   [ Ignore ]   [ # 175 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  02-08-2008

Just did a simple WIKI entry on this:

http://expressionengine.com/wiki/Hard_Coded_Stand_Alone_EDIT_Form_Guide/

Hope it helps.

 Signature 

Unintentionally Vague..  My mind seems to jumble it all up and when it gets spat out it makes perfect sense to me but everyone within earshot is looking at me in this really odd way..  I perpetually struggle to be clear.

“Of all the things I’ve lost, I miss my mind the most.” - unknown

EE Sites I’ve done: movingonradio.com | divorcerecoverytoday.com | thirdreader.com | peckishwriter.com | cityjobclub.org

Profile
 
 
Posted: 27 June 2008 04:40 AM   [ Ignore ]   [ # 176 ]  
Summer Student
Total Posts:  23
Joined  01-28-2008

I’ve some question about the SOAF edit form.

First of all, the following code is not working (the value is not a parameter of the select tag) and is bad XHTML. Is there a solutions to automatic select the right category and status?

<select name="category[]" value="{categories}{category_name}{/categories}">

And second, there is no check if the user is authorised for edit the entry. I want to have, that each user can edit his OWN entries, but in this solution, everybody who type in the right URL can edit the entry, right?

Profile
 
 
Posted: 27 June 2008 08:25 AM   [ Ignore ]   [ # 177 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  738
Joined  07-18-2006

Last time I did this, I used the “Form Helper” extension (use search to find it) and within that extension is an option to give access only to the author.  So my code looks like this:

{exp:form_helper:member_is_author author_id="{author_id}"}
                {if member_not_author}
                {embed
="includes/unauthorized"}
                {
/if}
                
<p>Use the form below to update your job listing. If you would like to remove the listing use the delete button at the bottom of the form. Required fields are marked with an askerisk (<span class="required">*</span>).</p>
                
{exp:weblog:entry_form weblog="member_job_listings" return="pages/thank_you/update_a_job"}
                
<fieldset>

etc.

Profile
 
 
Posted: 27 June 2008 10:16 AM   [ Ignore ]   [ # 178 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  02-08-2008

Thanks for the heads up on the category bit..  I’ll see if I can figure it out.

On the member / admin only..
If a member does not have permission to edit / create entries, the form won’t be displayed to them at all.

When I did a submission manager for a friend, to display only the submissions created by the author I used the author_id option:

{exp:weblog:entries weblog="submissions" author_id="CURRENT_USER" orderby="date" limit="5" }

You could use the same thing for the SA(Edid)F.

You can also wrap admin only sections with if’s to restrict access:

{if logged_out}<center>This is a restricted area.  <a >Return to Main Site</a> | <a >Login</a></center>{/if}

{if group_id
!= 1}<center>This is a restricted area.  <a >Return to Main Site</a></center>{/if}

{if group_id
== 1}Admin stuff...{/if}

Hope this helps..

 Signature 

Unintentionally Vague..  My mind seems to jumble it all up and when it gets spat out it makes perfect sense to me but everyone within earshot is looking at me in this really odd way..  I perpetually struggle to be clear.

“Of all the things I’ve lost, I miss my mind the most.” - unknown

EE Sites I’ve done: movingonradio.com | divorcerecoverytoday.com | thirdreader.com | peckishwriter.com | cityjobclub.org

Profile
 
 
Posted: 27 June 2008 10:36 AM   [ Ignore ]   [ # 179 ]  
Summer Student
Total Posts:  23
Joined  01-28-2008

yeh oke, i will figure that out tomorrow.

but how about the selection of the right category and status of the entry? the value parameter of select tag, will not work!

Profile
 
 
Posted: 28 June 2008 12:16 AM   [ Ignore ]   [ # 180 ]  
Grad Student
Avatar
Rank
Total Posts:  99
Joined  02-08-2008

Ok..  It’s possible it can be done better than this but it’s good enough for me at the moment.

{category_menu}<select name="category"><OPTION selected value="{categories}{category_name}{/categories}">{categories}{category_name}{/categories}</OPTION>{select_options}</select>{/category_menu}

 Signature 

Unintentionally Vague..  My mind seems to jumble it all up and when it gets spat out it makes perfect sense to me but everyone within earshot is looking at me in this really odd way..  I perpetually struggle to be clear.

“Of all the things I’ve lost, I miss my mind the most.” - unknown

EE Sites I’ve done: movingonradio.com | divorcerecoverytoday.com | thirdreader.com | peckishwriter.com | cityjobclub.org

Profile
 
 
   
10 of 11
10
 
‹‹ empty new blog      MoBlog Auto Check? ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60728 Total Logged-in Users: 24
Total Topics: 73187 Total Anonymous Users: 14
Total Replies: 394722 Total Guests: 474
Total Posts: 467909    
Members ( View Memberlist )
Newest Members:  Chethansisiharmonijoe_carneypsykonautJitsunROPasterfredpwsAnita VJMaxthehuskybear