Skip to content

Commit

Permalink
Salesforce 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarialounes committed Mar 8, 2015
1 parent 18ed2d9 commit ed35675
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 26 deletions.
10 changes: 5 additions & 5 deletions modules/salesforce/classes/SalesforceSQL.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* 2012-2015 ZL Development
*
Expand All @@ -22,7 +23,6 @@
* @copyright 2012-2015 ZL Development
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

ini_set('display_errors', 1);
ini_set('errors_reporting', E_ALL);

Expand All @@ -43,27 +43,23 @@ public static function save(SalesforceEntity $entity) {
. "'" . $entity->getEtat() . "', "
. "'" . $entity->getErreurPaybox() . "', "
. "'" . $entity->getErreurPaypal() . "', "

. "'" . $entity->getEstAdhesion() . "', "
. "'" . $entity->getRecuFiscal() . "', "
. "'" . addslashes($entity->getCommentaire()) . "', "
. "'" . $entity->getURLInterface() . "', "
. "'" . $entity->getAdresseIP() . "', "

. "'" . $entity->getIntitule() . "', "
. "'" . $entity->getPanier() . "', "
. "'" . $entity->getIdClientBoutique() . "', "
. "'" . addslashes($entity->getNom()) . "', "
. "'" . addslashes($entity->getPrenom()) . "', "
. "'" . $entity->getCourriel() . "', "

. "'" . $entity->getTelephone() . "', "
. "'" . addslashes($entity->getAdresse()) . "', "
. "'" . addslashes($entity->getAdresseComplement()) . "', "
. "'" . $entity->getCodePostal() . "', "
. "'" . addslashes($entity->getVille()) . "', "
. "'" . addslashes($entity->getPays()) . "', "

. "'" . $entity->getNewsletter() . "', "
. "'" . $entity->getPasDePapier() . "', "
. "'" . $entity->getSyncEtat() . "'"
Expand All @@ -74,4 +70,8 @@ public static function save(SalesforceEntity $entity) {
}
}

public static function getAll() {
return (Db::getInstance()->ExecuteS("SELECT * FROM `" . _DB_PREFIX_ . "achats_clients_sync`"));
}

}
3 changes: 3 additions & 0 deletions modules/salesforce/salesforce.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
exit;

require_once('classes/SalesforceInstall.php');
require_once('classes/SalesforceSQL.php');

class Salesforce extends Module
{
Expand Down Expand Up @@ -67,7 +68,9 @@ public function getContent()
return;
}


$this->context->smarty->assign('module_dir', $this->_path);
$this->context->smarty->assign('entry', SalesforceSQL::getAll());
$output = $this->context->smarty->fetch($this->local_path.'views/templates/admin/configure.tpl');

return $output;
Expand Down
106 changes: 85 additions & 21 deletions modules/salesforce/views/templates/admin/configure.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,90 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*}

<div class="panel">
<h3><i class="icon icon-credit-card"></i> {l s='Salesforce' mod='salesforce'}</h3>
<p>
<strong>{l s='Here is my new payment module!' mod='salesforce'}</strong><br />
{l s='Thanks to PrestaShop, now I have a great module.' mod='salesforce'}<br />
{l s='I can configure it using the following configuration form.' mod='salesforce'}
</p>
<br />
<p>
{l s='This module will boost your sales!' mod='salesforce'}
</p>
</div>
<style type="text/css">
.table-responsive {
display: -moz-box;
overflow: scroll;
}
</style>

<div class="panel">
<h3><i class="icon icon-tags"></i> {l s='Documentation' mod='salesforce'}</h3>
<p>
&raquo; {l s='You can get a PDF documentation to configure this module' mod='salesforce'} :
<ul>
<li><a href="#" target="_blank">{l s='English' mod='salesforce'}</a></li>
<li><a href="#" target="_blank">{l s='French' mod='salesforce'}</a></li>
</ul>
</p>
</div>
<h3><i class="icon icon-credit-card"></i> {l s='Salesforce' mod='salesforce'}</h3>

<table class="table table-stripped table-hover table-responsive">
<thead>
<tr>
<th colspan="2">Actions</th>
<th>id</th>
<th>montant</th>
<th>date</th>
<th>choixPaiement</th>
<th>etat</th>
<th>erreurPaybox</th>
<th>erreurPaypal</th>
<th>estAdhesion</th>
<th>recuFiscal</th>
<th>commentaire</th>
<th>URLInterface</th>
<th>adresseIP</th>
<th>intitule</th>
<th>panier</th>
<th>id_client_boutique</th>
<th>nom</th>
<th>prenom</th>
<th>courriel</th>
<th>telephone</th>
<th>adresse</th>
<th>adresseComplement</th>
<th>codePostal</th>
<th>ville</th>
<th>pays</th>
<th>newsletter</th>
<th>pasDePapier</th>
<th>syncDate</th>
<th>SyncEtat</th>
<th>SyncErreur</th>
</tr>
</thead>

<tbody>
{foreach from=$entry item=foo}
<tr>
<td colspan="2">
<button class="btn btn-default" title="Marqué toSync">toSync</button>
<button class="btn btn-success" title="Marqué synchronisé">synchronised</button>
</td>
<td>{$foo['id']}</td>
<td>{$foo['montant']} €</td>
<td>{$foo['date']}</td>
<td>{$foo['choixPaiement']}</td>
<td>{$foo['etat']}</td>
<td>{$foo['erreurPaybox']}</td>
<td>{$foo['erreurPaypal']}</td>
<td>{$foo['estAdhesion']}</td>
<td>{$foo['recuFiscal']}</td>
<td>{$foo['commentaire']}</td>
<td>{$foo['URLInterface']}</td>
<td>{$foo['adresseIP']}</td>
<td>{$foo['intitule']}</td>
<td>{$foo['panier']}</td>
<td>{$foo['id_client_boutique']}</td>
<td>{$foo['nom']}</td>
<td>{$foo['prenom']}</td>
<td>{$foo['courriel']}</td>
<td>{$foo['telephone']}</td>
<td>{$foo['adresse']}</td>
<td>{$foo['adresseComplement']}</td>
<td>{$foo['codePostal']}</td>
<td>{$foo['ville']}</td>
<td>{$foo['pays']}</td>
<td>{$foo['newsletter']}</td>
<td>{$foo['pasDePapier']}</td>
<td>{$foo['syncDate']}</td>
<td>{$foo['syncEtat']}</td>
<td>{$foo['syncErreur']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>

0 comments on commit ed35675

Please sign in to comment.