Jump to content

Manol

Members
  • Posts

    292
  • Joined

  • Last visited

Posts posted by Manol

  1. I'm trying to implement a pay method, this is the code I pasted into a pw page.

    The problem is when I click at the bottom image (tpvirtual.jpg) I get a new blank window, but when I do it without pw as a normal php file under xampp it works ok.

    post-1191-0-57121100-1389355288_thumb.pnpost-1191-0-26324700-1389355287_thumb.pn

    <?PHP
    // If form is submitted with all required data then show the form
    // else show error page
    empty($Formulario) ?							
    	  ShowForm($Ds_Merchant_Amount,$Ds_Merchant_Currency,$prod) :
    	  ShowError();
    exit;
    ?>
    
    <?PHP
    
    function ShowError () {
    	echo "<html><head><title>Results</title></head><body><table width=100% height=50%><tr><td><p><h2><center>Compruebe que todos los datos del formulario son correctos!!</center></h2></p></td></tr></table></body></html>\n";
    } # End of function ShowError
    
    function ShowForm ($amount,$currency,$producto) {
    // Posted data
    global $HTTP_POST_VARS;
    
    // Valores constantes del comercio
    $url_tpvv='https://sis-t.redsys.es:25443/sis/realizarPago';
    $clave='qwertyasdf0123456789';
    $name='Comercio Pruebas';
    $code='272043225';
    $terminal='1';
    $order=date('ymdHis');
    $amount='25';
    $currency='978';
    $transactionType='0';
    $urlMerchant='http://www.redsys.es';
    $producto='Zapatos';
    
    // Now, print the HTML script
    echo "<html><head><title>Comercio Simulador</title></head>
    <script language=JavaScript>
    function calc() { 
    vent=window.open('','tpv','width=725,height=600,scrollbars=no,resizable=yes,status=yes,menubar=no,location=no');
    document.forms[0].submit();}
    </script>
    <body bgcolor=white>
    <form name=compra action=$url_tpvv method=post target=tpv>
    <pre>
    <table>
    <tr><td>
    <h2>Comercio de prueba.</h2>
    </td></tr><tr><td>
    Comercio: <font color=blue>$name</font>
    </td></tr><tr><td>
    FUC: <font color=blue>$code</font>
    </td></tr><tr><td>
    Terminal: <font color=blue>$terminal</font>
    </td></tr><tr><td>
    Pedido: <font color=blue>$order</font>
    </td></tr><tr><td>
    Producto: <font color=blue>$producto</font>
    </td></tr><tr><td>
    Importe: <font color=blue>$amount</font>
    </td></tr><tr><td>
    Tipo de Operacion: <font color=blue>$transactionType (Autorización)</font>
    </td></tr><tr><td>
    URL del comercio: <font color=blue>$urlMerchant</font>
    </td></tr><tr><td>";
    
    // Currency strings 
    if ($currency == "978") {
    	echo "Moneda: <font color=blue>Euros</font>";
    }
    
    echo "</td>
    </tr><tr><td>
    <input type=hidden name=Ds_Merchant_Amount value='$amount'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_Currency value='$currency'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_Order  value='$order'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_MerchantCode value='$code'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_Terminal value='$terminal'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_TransactionType value='$transactionType'>
    </td></tr><tr><td>
    <input type=hidden name=Ds_Merchant_MerchantURL value='$urlMerchant'>
    </td></tr><tr><td>";
    
    // Compute hash to sign form data
    // $signature=sha1_hex($amount,$order,$code,$currency,$clave);
    $message = $amount.$order.$code.$currency.$transactionType.$urlMerchant.$clave;
    $signature = strtoupper(sha1($message));
    
    echo "<input type=hidden name=Ds_Merchant_MerchantSignature value='$signature'>
    </td></tr>
    </table>
    <center><a href='javascript:calc()'><img src='/tpvirtual.jpg' border=0 ALT='TPV Virtual'></a></center>
    </pre>
    </form>										  
    </body></html>";
    } # End of function ShowForm
    ?>
    

    Any ideas?, thanks

  2. Hello guys.

        I've been asked to create a calendar for a motorbike school (booking, events, colors, d&d, gantt ...).

        Now is a great opportunity to create a general events calendar module which can be used in many ambits and share it with this great community that has given me so many things.

        I've been looking around for some calendars and found the two shown in the title as possible candidates, what do you think, do you know any others?

    DHXScheduler

    Arshaw's Fullcalendar

  3. Hello.

        I haven't developed a module yet but the time has come to get my hands dirty.

        I've been looking some modules ( PageListBetterLabels.modulePageListImageLabel.module) but couldn't figure out how to do what I need.

        As an example, I would like to hide all children from cities but berlin ( I'll have a user called berlin_mark and he'll be allowed to see just this page but not the other cities ).

    home

    --cities

    ----amsterdam

    ----new-york

    ----berlin

    ----london

    --other-things

    Thanks.

  4. Marvelous, easy when you now how to.

    		$t->useRoles = 1;
    		$t->set("roles", array('1316','2006')); //view
    		$t->set("editRoles", array('1316','2006'));  //edit
    		$t->set("createRoles", array('1316','2006')); //create
    		$t->set("addRoles", array('1316','2006')); //add children
    

    The array contains as Martijn said the roles's ids.

    Thanks to you three.

    • Like 2
  5. Hello Martijn.

        Your code is working I used

    		$t->useRoles = 1;
    		$t->set("roles", array('1316','2006')); // where 1234 is the ID of the role you want to add.
    

    It allows those roles to view pages using this templates but edit, create and add.



    Hi Soma.

        This page will have many roles and users I prefer do to it automatically with the api.

    • Like 1
  6. I've got that:

    	<?php 
    		// fieldgroup
    		$fg = new Fieldgroup();
    		$fg->name = "myfg";
    		$fg->add("title"); // add some fields
    		$fg->save();
    
    		// template
    		$t = new Template();
    		$t->name = "mytpl";
    		$t->fieldgroup = $fg;
    		$t->save();  
    
    	?>
    

    and wish to add access ( view, edit, create,a add children to this template ) to certain roles, and remove access to this template to other roles?

    When I create a template it gives view access to all roles but I'm interested in getting something like the image down.

    post-1191-0-94069600-1388763484_thumb.pn

  7. Hello.

        Following Soma's instructions I have removed some tabs for a page, now I would like to hide some buttons in the following image:

    post-1191-0-87085000-1388676292_thumb.pn

    for the tabs it was 

       $this->addHookAfter("ProcessPageEdit::buildForm", $this, "removeTabs");
    ...	       
       $fieldset = $form->find("id=ProcessPageEditSettings")->first();
       $form->remove($fieldset); 

    what would be the hook and how do I get the buttons I wish?

    Thank you.

  8. Unify theme.


     


        With adamspruijt' Unify theme and using Ryan's marker module I'm getting some view problems, controls are gone.


     


    I solved that adding those lines to style.css (admin-theme)


     



    .gmnoprint img {
    max-width: none;
    }
    • Like 1
  9. I'm using the same template because sometimes I need to look for all cities (template=city) and they don't share the same father, if so I would get cities->children() but is not the case.

    In any case thank you for your help I'm reconsidering moving all cities under the same father so I could use your approach which is simple and simplicity is in most cases the best solution.

  10. Happy Christmas.

        I'm developing a site, it follows this structure:

    cities

    ----city1 (city template )

    --------building1 (building template)

    --------building2

    --------building3

    --------building4

    ----city2

    --------building1

    --------building2

    ----city3

    --------building1

    --------building2

    --------building3

    --------building4

    ...

    then I've got roles city1, city2, city3 ...

    My question  is:

    I wish users with role city1 to be able to edit only buildings within its city role but not others, is it possible without a hook?

    Thank you.

×
×
  • Create New...