This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
- jmobile (add parameter ">dol_use_jmobile=1&dol_optimize_smallscreen=1 and switch to small screen < 570 to enable with emulated jmobile)
- no javascript / usage for bind people (add parameter ">nojs=1 to force disable javascript)
- use with a text browser (add parameter ">textbrowser=1 to force detection of a text browser)
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
// Test1: form->selectDate using tzuser date
print "Test 1a: We must have here current date and hour for user (must match hour on browser). Note: Check your are logged so user TZ and DST are known.";
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60;
$offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60;
print " (dol_tz=".$offsettz." dol_dst=".$dol_dst.") \n";
print $form->selectDate(dol_now(), 'test1a', 1, 1, 0);
print '
'."\n";
print "Test 1b: We must have here current date with hours to 00:00. ";
print $form->selectDate('', 'test1b', 1, 1, 0);
print '
'."\n";
// Test2: form->selectDate using tzuser date
print "Test 2: We must have here 1970-01-01 00:00:00 selected (fields can be empty) \n";
print $form->selectDate(dol_get_first_day(1970, 1, false), 'test2', 1, 1, 1);
print '
'."\n";
// Test3: form->selectDate for 1970-01-01 00:00:00
print "Test 3: We must have here 1970-01-01 00:00:00 selected (fields are mandatory) \n";
print $form->selectDate(dol_get_first_day(1970, 1, false), 'test3', 1, 1, 0);
print '
'."\n";
// Test4a: a select
print "Test 4a: a select \n";
$array = array(1=>'Value 1', 2=>'Value 2', 3=>'Value 3 ith a very long text. aze eazeae e ae aeae a e a ea ea ea e a e aea e ae aeaeaeaze.');
$selected = 3;
print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100', 1);
print '
'."\n";
// Test6a: Upload of big files
print "Test 6a: Upload of big files \n";
print "The file will be uploaded in the directory: documents/test/temp/ \n";
if (is_file(DOL_DOCUMENT_ROOT.'/includes/flowjs/flow.js')) {
print '';
print ' No file selected.';
print '
0%
';
print ' ';
print '';
print '';
} else {
print "If this message displays, please add flow.js and flow.min.js files which can be found here: https://github.com/flowjs/flow.js and place the js lib in htdocs/includes/flowjs/ \n";
}
print '';
// End of page
llxFooter();
$db->close();