Skip to content

Commit

Permalink
0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
inoerp committed Dec 3, 2016
1 parent f3f3df1 commit 9f0ed20
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
38 changes: 22 additions & 16 deletions inoerp/extensions/ino_user/class_ino_user.inc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ class ino_user extends dbObject {
'identification_id',
'address_id',
'customer_name',
'supplier_name'
'supplier_name',
'notify_user_cb'
];
public $checkbox = [
"use_personal_db_cb"
Expand Down Expand Up @@ -162,6 +163,7 @@ class ino_user extends dbObject {
public $supplier_name;
public $auth_provider_id;
public $auth_provider_name;
public $notify_user_cb;

public function _before_showing() {

Expand Down Expand Up @@ -469,21 +471,9 @@ class ino_user extends dbObject {
global $si;
if ($this->ino_user_id) {
$msg = "New user registration is sucessful!";
// $subject = "User Registrtion @ " . $si->site_name;
// $message = "Dear " . $this->username . '<br> your regitraton is sucessful';
// $replyto = "From : admin@site.com";
$subject = "User Registration @" . $si->site_name;
$message = "<html> <body>Dear " . $this->username . ',<br><br>';
$message .= "<p>Welcome to " . $si->site_name . ' <br>You can now access the site with your registered user '
. ' name & password ';
$message .='<br><br>Thanks<br>' . $si->site_name . '</body></html>';
$im = new inomail();
$im->FromName = $si->site_name;
$im->addAddress($this->email, $this->username);
$im->addReplyTo($si->email, 'User Registration');
$im->Subject = $subject;
$im->Body = $message;
$im->ino_sendMail(true);
if ($this->notify_user_cb) {
$this->_notify_user();
}
}//new user registration complete
else {
$msg = "New user registration Failed!" . mysql_error();
Expand All @@ -496,6 +486,22 @@ class ino_user extends dbObject {
return $this->msg;
}

private function _notify_user() {
global $si;
$subject = "User Registration @" . $si->site_name;
$message = "<html> <body>Dear " . $this->username . ',<br><br>';
$message .= "<p>Welcome to " . $si->site_name . ' <br>You can now access the site with your registered user '
. ' name & password ';
$message .='<br><br>Thanks<br>' . $si->site_name . '</body></html>';
$im = new inomail();
$im->FromName = $si->site_name;
$im->addAddress($this->email, $this->username);
$im->addReplyTo($si->email, 'User Registration');
$im->Subject = $subject;
$im->Body = $message;
$im->ino_sendMail(true);
}

private function _create_address() {
//create address
$addr = new address();
Expand Down
2 changes: 2 additions & 0 deletions inoerp/extensions/ino_user/reg/user_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
echo '<div><div id="structure">' . access_denied("You can only view & update your own user details") . '</div></div>';
return;
}
$f = new inoform();
?>
<div id ="form_header">
<form method="post" id="user_header" name="user_header">
Expand All @@ -29,6 +30,7 @@
<li><?php $f->l_text_field_dm('last_name'); ?> </li>
<li><?php $f->l_text_field_dm('email'); ?> </li>
<li><?php $f->l_text_field_d('phone'); ?> </li>
<li><label><?php echo gettext('Notify User') ?></label><?php echo $f->checkBox_field('notify_user_cb' , 1); ?> </li>
</ul>
</div>
<div id="tabsHeader-2" class="tabContent">
Expand Down
1 change: 1 addition & 0 deletions inoerp/extensions/ino_user/user_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<li><?php $f->l_text_field_dm('last_name'); ?> </li>
<li><?php $f->l_text_field_dm('email'); ?> </li>
<li><?php $f->l_text_field_d('phone'); ?> </li>
<li><label><?php echo gettext('Notify User') ?></label><?php echo $f->checkBox_field('notify_user_cb' , 1); ?> </li>
</ul>
</div>
<div id="tabsHeader-2" class="tabContent">
Expand Down

0 comments on commit 9f0ed20

Please sign in to comment.