Jump to content

Manol

Members
  • Posts

    292
  • Joined

  • Last visited

Posts posted by Manol

  1. I got a field called entrega and defined as DateTime (Profields Table) with the following parameters

    dateInputFormat=Y-m-d
    timeInputFormat=H:i
    dateOutputFormat=Y-m-d
    timeOutputFormat=H:i
    datepicker=3
    defaultToday=0
    yearRange=-10:+10
    placeholder=
    textformatters=TextformatterEntities
    default=

    when I try to save same data with

    $newRow->entrega = date("Y-m-d H:i");

    I get 

    2018-05-30 00:00

    if I do 

    echo date("Y-m-d H:i");

    I get the right date and time.

    Thanks.

  2. I'm trying to hide an inputfield but label still appears:

    $field = $modules->get("InputfieldText");
    $field->attr('id+name','name');
    $field->attr('v-model','usuario');
    $field->attr('style','display: none');
    $field->required = 1;
    $form->append($field);

    476391784_Capturadepantalla2018-05-30alas18_11_54.png.e7e20b49b473442bebb056a8cb113a51.png

  3. Using Runtimemarkup I've tried to change the title of the page and it works

    $page->set('title', 'New title');
    $page->save();
    return "";

    but when I try to change an inputfield of type text it doesn't

    $page->my_field = '22223333';
    // $page->my_field->attr('value', '22223333'); neither works
    $page->save();
    return "";

    any advice, thanks.

  4. I've tried to change the title of the page and it works

    $page->set('title', 'New title');
    $page->save();
    return "";

    but when I try to change an inputfield of type text it doesn't

    $page->my_field = '22223333';
    // $page->my_field->attr('value', '22223333'); neither works
    $page->save();
    return "";

    any advice, thanks.

  5. 22 minutes ago, Autofahrn said:

    Try this:

    
    $test = $page->protabla->makeBlankItem(); // getNew(); is wrong, allocation done by makeBlankItem()
    $page->of(false);	// always a good idea
    $test->name = date('D, d M Y H:i:s');
    $test->notes = 'my note';
    // $test->save();	// not required
    $page->protabla->add($test);
    $page->save('protabla');	// only save that field
    $page->of(true);

    functional test code (with delayed output) here:

    
    <?php namespace ProcessWire;
    
    $test = $page->protabla->makeBlankItem();
    $page->of(false);	// always a good idea
    $test->name = date('D, d M Y H:i:s');
    $test->notes = 'my note';
    $page->protabla->add($test);
    $page->save('protabla');	// only save that field
    $page->of(true);
    
    $content = "<h4>{$page->title}</h4>";
    $content .= "<table>";
    foreach($page->protabla as $pt)
    	{
    	$content .= "<tr><td>{$pt->name}</td><td>{$pt->notes}</td></tr>";
    	}
    $content .= "</table>";

    Edit: Maybe this should be moved to the ProFields Table support forum.

    Awesome!!

  6. It gives the following error:

    Error: Uncaught Error: Call to a member function save() on array in /......php:180
    Stack trace:
    #0 /wire/core/TemplateFile.php(287): require()
    #1 //wire/core/Wire.php(380): ProcessWire\TemplateFile->___render()
    #2 /wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array)
    #3 //wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array)
    #4 //wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array)
    #5 //wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent))
    #6 //wire/core/WireHooks.php(723): ProcessWire\Wire->_callMethod('___renderPage', Array)
    #7 //wire/core/Wire.php(442): ProcessWire\WireHoo (línea 180 de ....n.php) 

     

  7. Hello.

         I've a protable with fields:

    • name(text)
    • notes(textarea)

         How can I add a new row and populate the fields?.

    $test = $page->protabla->getNew();
    $test->name = 'my name';
    $test->notes = 'my note';
    $test->save();

    Thanks

  8. I've this piece of code

    $p = wire('pages')->get(1024);
    echo $p->resp;    // OK
    $p->resp = "33";  // not working
    $p->of(false);
    $p->save();

    I can read the output of $p->resp, but when I try to save a new value $p->resp="33" is not working, any ideas.

     

    Thanks.

  9. I get the following error trying to upload images, any idea, thanks.

     

    2018-04-19 08:49:34    manol   ...  Error:     Uncaught Error: Call to a member function getConfigData() on null in /home.../wire/core/Pageimage.php:486 Stack trace: #0 
     

    Captura de pantalla 2018-04-19 a las 8.56.45.png

  10. Hello.

        I'm developing a cooking recipes website, people subscribe to it to get daily recipes.

        What would be the best way to send emails to them using fields and images from a template and most important that those email can be opened from a mobile device and most email clients and see it correctly.

     

    Thanks.

  11. <?php 
    
    	$pdf = $modules->get('WirePDF');
    	$pdf->pageFormat = 'A4';
    	$pdf->bottomMargin = 10;
    
    	$mpdf = $pdf->mpdf;
    
    	$mpdf->AddPageByArray(array(
    	    'orientation' => 'L',
    	    'mgl' => '50',
    	    'mgr' => '50',
    	    'mgt' => '50',
    	    'mgb' => '50',
    	    'mgh' => '10',
    	    'mgf' => '10',
    	    ));
    
     ?>

    Still not getting the margin within header and body, not sure if I've defined it the right way

  12. Does anybody know how to solve with Pages2Pdf second page content top margin?, I attach an image so you can see that the paragraph hasn't got any padding or margin although is set.

    Captura de pantalla 2017-07-26 a las 19.31.24.png

  13. 4 hours ago, bernhard said:

    you could do that quite easily using jquery datatables: https://datatables.net/extensions/scroller/examples/initialisation/large_js_source.html

    in the example they have 50.000 records without a problem. i'm working on a new datatables fieldtype right now. do you need it for the front or backend?

    maybe you can get some inspiration here, but be advised that i'm working on a new version (fieldtype similar to my handsontable fieldtype) and this module will change completely ;)

    edit: of course server-side would be better and client-side depends on the clients machine. so if you have special requirements that could or could not be a good way to go...

    That look very promising I'll give it a try

    • Like 1
  14. Hello forum.

     

        I've about 10000 vehicles to filter in a table in the frontend with about 10 fields, c3, title, image, km,  date, axes, url ... in the past I did something similar with angular but probably there are to many items to filter with this  technology. It will be a kind of excel table with filters.

       What do you think? is it better to filter them in php with pw api or angular would be better, any other ideas?

     

    Thanks.

×
×
  • Create New...