diff --git a/TODO b/TODO index 96cd7bd..33c7a3a 100755 --- a/TODO +++ b/TODO @@ -9,12 +9,3 @@ Manage paybacks : ================= * TODO : Payback system (class should be ok) * TODO : Global payback - -To test : -========= -* Connection form -* Remember me ? -* Edit notice -* Add / Edit user -* Change password -* Change settings diff --git a/inc/Payback.class.php b/inc/Payback.class.php deleted file mode 100644 index f1e7f6f..0000000 --- a/inc/Payback.class.php +++ /dev/null @@ -1,90 +0,0 @@ -'key', - 'invoice_id'=>'int', - 'amount'=>'float', - 'from'=>'int', - 'to'=>'int' - ); - - public function __construct() { - parent::__construct(); - } - - // Getters - // ======= - - public function getId() { - return (int) $this->id; - } - - public function getInvoice() { - return (int) $this->invoice_id; - } - - public function getAmount() { - return (float) $this->amount; - } - - public function getFrom() { - return (int) $this->from; - } - - public function getTo() { - return (int) $this->to; - } - - // Setters - // ======= - - public function setId($id) { - $this->id = (int) $id; - } - - public function setInvoice($invoice_id) { - $this->invoice_id = (int) $invoice_id; - } - - public function setAmount($amount) { - $this->amount = (float) $amount; - } - - public function setFrom($from) { - $this->from = (int) $from; - } - - public function setTo($to) { - $this->to = (int) $to; - } - - // Restores object from array - // ========================== - - public function sessionRestore($data, $serialized = false) { - if($serialized) - $data = unserialize($data); - - $this->setId($data['id']); - $this->setInvoice($data['invoice_id']); - $this->setAmount($data['amount']); - $this->setFrom($data['from']); - $this->setTo($data['to']); - } - - // Maps htmlspecialchars on the class before display - // ================================================= - - public function secureDisplay() { - $this->id = (int) $this->id; - $this->invoice_id = (int) $this->invoice_id; - $this->amount = (float) $this->amount; - $this->from = (int) $this->from; - $this->to = (int) $this->to; - } - } diff --git a/inc/functions.php b/inc/functions.php index 40258f2..a464681 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -79,25 +79,3 @@ return $return; } - - function formatUsersIn($users_in, $all_users) { - global $localized; - // TODO : Move this function to somewhere else ? - $return = ''; - $users_in = $users_in->get(); - - $i = false; - foreach($users_in as $user_in=>$guests) { - if($i) { $return .= '
'; } else { $i = true; } - - $return .= $all_users[$user_in]->getDisplayName(); - if($guests != 0) { - if($guests > 1) - $return .= ' ('.$guests.' '.$localized['guest'][LANG].'s)'; - else - $return .= ' ('.$guests.' '.$localized['guest'][LANG].')'; - } - } - - return $return; - } diff --git a/inc/rain.tpl.class.php b/inc/rain.tpl.class.php index ef5e5fa..0d153ce 100644 --- a/inc/rain.tpl.class.php +++ b/inc/rain.tpl.class.php @@ -478,7 +478,7 @@ class RainTPL{ $value = "\$value$loop_level"; // value //loop code - $compiled_code .= " $value ){ $counter++; ?>"; + $compiled_code .= " $value ){ $counter++; ?>"; } diff --git a/tpl/default_en/index.html b/tpl/default_en/index.html index c058c60..6781639 100755 --- a/tpl/default_en/index.html +++ b/tpl/default_en/index.html @@ -42,7 +42,17 @@ {$value->getDate('d-m-Y A')} {$users[$value->getBuyer()]->getDisplayName()} - {function="formatUsersIn($value->getUsersIn(), $users)"} + + {loop="$value->getUsersIn()->get()"} + {$users[$key2]->getDisplayName()} + {if condition="$value2 > 1"} + ({$value2} guests) + {elseif condition="$value2 == 1"} + ({$value2} guest) + {/if} +
+ {/loop} + {$value->getAmount()} {$value->getWhat()} Edit