xoops forums

DaGoN

Just popping in
Posted on: 2007/4/26 8:23
DaGoN
DaGoN (Show more)
Just popping in
Posts: 3
Since: 2007/4/25
#1

Problem with XoopsFormDateTime

Hi to all,
i've make a little form with custom template but element XoopsFormDateTime it doesn't display, while anothers components yes.

My XOOPS version is 2.0.16.

My code (include/form_edit.inc.php):
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";

$edit_form = new XoopsThemeForm("Edit""edit_form""edit.php");
    
$descrizione = new XoopsFormTextArea("Descrizione""descrizione",$eo_descr,10,100,"desc");
     
$edit_form->addElement($descrizione,true);
     echo 
xoops_getUserTimestamp($eo_ins_date);
    
$data = new XoopsFormDateTime("Data","data"15,/*$eo_ins_date*/);
    
$edit_form->addElement($data,false);
    
$note = new XoopsFormTextArea("Note""note",$eo_note,10,100,"note");
    
$edit_form->addElement($note,true);
    
$edit_form->addElement(new XoopsFormHidden('id'$id));
    
$button_tray = new XoopsFormElementTray(' ' ,' ''button');
    
$button_tray->addElement(new XoopsFormButton('','post',"Modifica",'submit'));
    
$edit_form->addElement($button_tray);


Template:
<div align="center"><font color="#FF0000"><strong>test</strong> </font></div>

<
form name="<{$edit_form.name}>" action="<{$edit_form.action}>" method="<{$edit_form.method}>">

<
table cellpadding="0" cellspacing="1" width="98%" border="1" class="outer">
  <
tr>
    <
th align="center" colspan="2"><{$edit_form.title}></td>
  </
tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.descrizione.caption}>:</td>
    <
td class="even"><{$edit_form.elements.descrizione.body}></td>
  </
tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.data.caption}>:</td>
    <
td class="even"><{$edit_form.elements.data.body}></td>
  </
tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.note.caption}>:</td>
    <
td class="even"><{$edit_form.elements.note.body}></td>
  </
tr>
  <
tr>
    <
td class="head" ><{$edit_form.elements.button.caption}></td>
    <
td class="<{cycle values="even,odd"}>"><{$edit_form.elements.button.body}></td>
  </
tr>
</
table>
<
br />
<{
$edit_form.elements.id.body}>
</
form>
<
div style="margin-right:auto;margin-left:50%;"><input type="submit" value="indietro" onclick="history.go(-1);" /></div>


Anyone have some problem?

Thanks in adv,
DaGoN

DaGoN

Just popping in
Posted on: 2007/4/28 16:47
DaGoN
DaGoN (Show more)
Just popping in
Posts: 3
Since: 2007/4/25
#2

Re: Problem with XoopsFormDateTime

Now i know because XOOPS is only a CMS toy and it's not a real good CMS.
This is a good reason to looking for another CMS.
No future without support...

Goodbye,
DaGoN

DobePhat

Friend of XOOPS
Posted on: 2007/4/28 17:39
DobePhat
DobePhat (Show more)
Friend of XOOPS
Posts: 656
Since: 2003/4/15
#3

Re: Problem with XoopsFormDateTime

Its a great CMS.

I just dont understand your question and I think others may not either.

Sorry couldnt be of help.

earplane

Just popping in
Posted on: 2007/4/28 17:57
earplane
earplane (Show more)
Just popping in
Posts: 35
Since: 2002/10/1
#4

Re: Problem with XoopsFormDateTime

What language are you using?

I used to have problems with the popup calendar not showing, and I traced it down to a faulty language file. But if you're using English that's probably not it.

If you're using a non-English language you may want to try if it works with XOOPS set to English.

lesage

Just popping in
Posted on: 2007/10/15 3:05
lesage
lesage (Show more)
Just popping in
Posts: 2
Since: 2007/10/10
#5

Re: Problem with XoopsFormDateTime

i have the same problem with XoopsFormDateTime
i can'T get the enter or selected date.
Please when you find some answer let me know.

Catzwolf

Home away from home
Posted on: 2007/10/15 10:02
Catzwolf
Catzwolf (Show more)
Home away from home
Posts: 1392
Since: 2007/9/30
#6

Re: Problem with XoopsFormDateTime

Quote:

lesage wrote:
i have the same problem with XoopsFormDateTime
i can'T get the enter or selected date.
Please when you find some answer let me know.


Try using 'XoopsFormTextDateSelect' rather than 'XoopsFormDateTime' at the moment, there seems to be an issue somewhere when rendering the form via smarty, it seems ok if you do it the other way.

Working method but not with smarty:

include_once XOOPS_ROOT_PATH '/class/xoopsformloader.php';
        
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
        
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
        
$edit_form->addElement$descrizionetrue );

        
$data = new XoopsFormDateTime"Data""data"150/*$eo_ins_date*/ );
        
$edit_form->addElement$datafalse );

        
$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
        
$edit_form->addElement$notetrue );
        
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

        
$button_tray = new XoopsFormElementTray'&nbsp;' '&nbsp;''button' );
        
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
        
$edit_form->addElement$button_tray );
        
$edit_form->display();


You could buffer the output and at it to a smarty tag

example:

ob_start();
include_once 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
$edit_form->addElement$descrizionetrue );

$data = new XoopsFormDateTime"Data""data"150/*$eo_ins_date*/ );
$edit_form->addElement$datafalse );

$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
$edit_form->addElement$notetrue );
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

$button_tray = new XoopsFormElementTray'&nbsp;' '&nbsp;''button' );
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
$edit_form->addElement$button_tray );
$edit_form->display();
$output ob_get_contents();
ob_end_clean();
$xoopsTpl->assign'form'$output );


Or you could do it this way:

include_once XOOPS_ROOT_PATH '/class/xoopsformloader.php';
                
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
                
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
                
$edit_form->addElement$descrizionetrue );

                
$data = new XoopsFormDateTime"Data""data"15);
                
$edit_form->addElement$datafalse );

                
$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
                
$edit_form->addElement$notetrue );
                
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

                
$button_tray = new XoopsFormElementTray'&nbsp;' '&nbsp;''button' );
                
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
                
$edit_form->addElement$button_tray );
                
$edit_form->assign$xoopsTpl );


Remember When working with XoopsFormDateTime it returns an Array with two elements. The first element requires some work to be usable.

$array['date'] and $array['time]

$array['time'] will have to be converted to unixtime format and time added to it

i.e:

$date = strtotime($array['date']) + $array['time];

I will try and find out the reason why the first method does not work as it should.

Catz

Hope this helps.

earplane

Just popping in
Posted on: 2007/10/15 12:17
earplane
earplane (Show more)
Just popping in
Posts: 35
Since: 2002/10/1
#7

Re: Problem with XoopsFormDateTime

What language are you using? I had a problem with the popup calendar not showing in Norwegian, but it worked OK in English. It turned out that the JSCalendar had a faulty language file.

Try changing your site language, it may not be a XOOPS bug at all

Catzwolf

Home away from home
Posted on: 2007/10/15 15:05
Catzwolf
Catzwolf (Show more)
Home away from home
Posts: 1392
Since: 2007/9/30
#8

Re: Problem with XoopsFormDateTime

Quote:

earplane wrote:
What language are you using? I had a problem with the popup calendar not showing in Norwegian, but it worked OK in English. It turned out that the JSCalendar had a faulty language file.

Try changing your site language, it may not be a XOOPS bug at all


This was using the default english language and I would have to state it does seem like a bug but I have not fould the reason behind yet.