Browse Source

Version 1.1.6 : On mets en place un inclure qui va afficher les valeurs + doc

svn/root/tags/v1.1.10
pierrekuhn82@gmail.com 4 years ago
parent
commit
0c095b05ee
  1. 1
      .gitattributes
  2. 1
      classes/octopush/config.inc.php
  3. 42
      classes/octopush/sms.inc.php
  4. 4
      formulaires/configurer_sms.html
  5. 3
      inclure/octopush_balance.html
  6. 6
      paquet.xml
  7. 12
      sms_fonctions.php

1
.gitattributes

@ -5,6 +5,7 @@ classes/octopush/sms.inc.php -text
classes/smsfactor/AccuseReceptionSMSClass.php -text
classes/smsfactor/sendSMSclass.php -text
formulaires/configurer_sms.html -text
inclure/octopush_balance.html -text
lang/paquet-sms.xml -text
lang/paquet-sms_fr.php -text
lang/sms.xml -text

1
classes/octopush/config.inc.php

@ -41,4 +41,3 @@ define('DIFFERE', 2);
define('SIMULATION', 'simu');
define('REEL', 'real');
?>

42
classes/octopush/sms.inc.php

@ -48,7 +48,7 @@ class SMS_OCTOSPUSH
$this->user_login = '';
$this->api_key = '';
$this->sms_text = '';
$this->sms_text = '';
$this->sms_recipients = array();
$this->recipients_first_names = array();
@ -80,9 +80,9 @@ class SMS_OCTOSPUSH
public function send()
{
$domain = DOMAIN;
$path = PATH_SMS;
$port = PORT;
$domain = DOMAIN;
$path = PATH_SMS;
$port = PORT;
$data = array(
'user_login' => $this->user_login,
@ -202,13 +202,13 @@ class SMS_OCTOSPUSH
$port = PORT;
$data = array(
'user_login' => $this->user_login,
'api_key' => $this->api_key,
'first_name' => $first_name,
'last_name' => $last_name,
'raison_sociale' => $raison_sociale,
'alert_bound' => intval($alert_bound),
'alert_sms_type' => $alert_sms_type
'user_login' => $this->user_login,
'api_key' => $this->api_key,
'first_name' => $first_name,
'last_name' => $last_name,
'raison_sociale'=> $raison_sociale,
'alert_bound' => intval($alert_bound),
'alert_sms_type'=> $alert_sms_type
);
return trim($this->_httpRequest($domain, $path, $port, $data));
@ -228,9 +228,9 @@ class SMS_OCTOSPUSH
$port = PORT;
$data = array(
'user_login' => $user_login,
'api_key' => $api_key,
'sub_account_email' => $sub_account_email
'user_login' => $user_login,
'api_key' => $api_key,
'sub_account_email' => $sub_account_email
);
$xml_return = trim($this->_httpRequest($domain, $path, $port, $data));
@ -268,12 +268,12 @@ class SMS_OCTOSPUSH
}
$data = array(
'user_login' => $user_login,
'api_key' => $api_key,
'sub_account_email' => $sub_account_email,
'sms_number' => $sms_amount,
'sms_type' => $sms_type,
'token' => $token
'user_login' => $user_login,
'api_key' => $api_key,
'sub_account_email' => $sub_account_email,
'sms_number' => $sms_amount,
'sms_type' => $sms_type,
'token' => $token
);
$xml_return = trim($this->_httpRequest($domain, $path, $port, $data));
@ -545,5 +545,3 @@ class SMS_OCTOSPUSH
}
}
?>

4
formulaires/configurer_sms.html

@ -61,9 +61,7 @@ $(function(){
</li>
<li class="fieldset octopush">
<h3 class="legend">Octopush</h3>
#SET{standard,#VAL{standard}|balance}
#SET{premium,#VAL{premium}|balance}
<p class="explication"><:sms:explication_octopush{standard=#GET{standard}, premium=#GET{premium}}:></p>
<p class="explication"><INCLURE{fond=inclure/octopush_balance} /></p>
<ul>
<li class="editer">
<label for="login_octopush"><:sms:login:></label>

3
inclure/octopush_balance.html

@ -0,0 +1,3 @@
#SET{standard,#VAL{standard}|balance}
#SET{premium,#VAL{premium}|balance}
<:sms:explication_octopush{standard=#GET{standard}, premium=#GET{premium}}:>

6
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="sms"
categorie="communication"
version="1.1.5"
version="1.1.6"
etat="test"
compatibilite="[3.0.0;3.2.*]"
logo="prive/themes/spip/images/sms-64.png"
@ -14,7 +14,7 @@
<licence>GNU/GPL</licence>
<pipeline nom="declarer_tables_objets_sql" inclure ="base/sms.php" />
<pipeline nom="declarer_tables_interfaces" inclure ="base/sms.php" />
<pipeline nom="declarer_tables_objets_sql" inclure="base/sms.php" />
<pipeline nom="declarer_tables_interfaces" inclure="base/sms.php" />
</paquet>

12
sms_fonctions.php

@ -117,6 +117,18 @@ function octopush($sms_text,$sms_recipients,$arg) {
$xml = simplexml_load_string($xml);
return $xml;
}
/**
* Afficher la balance de sms disponible
*
* <INCLURE{fond=inclure/octopush_balance} /> pour l'affichage
*
* @param string $type
* standard ou premium
* @return boolean
* valeur en nombre entier de sms restant
**/
function filtre_balance($type) {
$username = lire_config('sms/login_octopush');
$password = lire_config('sms/cle_api_octopush');

Loading…
Cancel
Save