Changeset 292
- Timestamp:
- 03/08/08 16:07:56 (5 years ago)
- Location:
- application.register
- Files:
-
- 4 modified
-
files/lib/action/UserGroupOptionsAction.class.php (modified) (3 diffs)
-
files/lib/system/event/listener/UserGroupAdministrateMailListener.class.php (modified) (3 diffs)
-
files/lib/system/event/listener/UserGroupApplyMailListener.class.php (modified) (1 diff)
-
templates/userGroupApplyMail.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
application.register/files/lib/action/UserGroupOptionsAction.class.php
r276 r292 11 11 */ 12 12 class UserGroupOptionsAction extends AbstractAction { 13 public $ enabled = array();13 public $displayNotification=0, $emailNotification=0; 14 14 public $groupID = 0; 15 15 public $group; … … 27 27 throw new IllegalLinkException(); 28 28 } 29 $this->displayNotification = isset($_POST['groupApplyMail_display']) ? intval($_POST['groupApplyMail_display']) : 0; 30 $this->emailNotification = isset($_POST['groupApplyMail_email']) ? intval($_POST['groupApplyMail_email']) : 0; 29 31 30 $this->enabled = isset($_POST['groupApplyMail_enabled']) ? intval($_POST['groupApplyMail_enabled']) : 0;31 32 } 32 33 … … 43 44 } 44 45 45 if($this-> enabled) {46 $sql = "INSERT IGNORE46 if($this->displayNotification || $this->emailNotification) { 47 $sql = "INSERT 47 48 INTO wcf".WCF_N."_groupapplymail 48 (userID, groupID )49 (userID, groupID, displayNotification, emailNotification) 49 50 VALUES 50 (".WCF::getUser()->userID.", ".intval($this->groupID).")"; 51 (".WCF::getUser()->userID.", ".intval($this->groupID).", ".$this->displayNotification.", ".$this->emailNotification.") 52 ON DUPLICATE KEY 53 UPDATE displayNotification=".$this->displayNotification.", 54 emailNotification=".$this->emailNotification; 51 55 52 56 } else { -
application.register/files/lib/system/event/listener/UserGroupAdministrateMailListener.class.php
r286 r292 15 15 16 16 //data 17 protected $ enabled;17 protected $displayNotification=0, $emailNotification=0; 18 18 19 19 /** … … 38 38 */ 39 39 protected function readData() { 40 $sql = "SELECT COUNT(*) AS c 41 FROM wcf".WCF_N."_groupapplymail 42 WHERE groupID = '".intval($this->eventObj->groupID)."' 43 AND userID = '".WCF::getUser()->userID."'"; 40 $sql = "SELECT displayNotification, 41 emailNotification 42 FROM wcf".WCF_N."_group_application_mail 43 WHERE groupID = ".intval($this->eventObj->groupID)." 44 AND userID = ".WCF::getUser()->userID; 44 45 $row = WCF::getDB()->getFirstRow($sql); 45 $this->enabled = intval($row['c']); 46 if($row) { 47 $this->displayNotification = intval($row['displayNotification']); 48 $this->emailNotification = intval($row['emailNotification']); 49 } 46 50 } 47 51 … … 52 56 WCF::getTPL()->assign(array( 53 57 'groupID' => $this->eventObj->groupID, 54 'enabled' => $this->enabled, 58 'displayl' => $this->displayNotification, 59 'email' => $this->emailNotification, 55 60 'groupType' => $this->eventObj->group->groupType 56 61 )); -
application.register/files/lib/system/event/listener/UserGroupApplyMailListener.class.php
r286 r292 26 26 FROM wcf".WCF_N."_groupapplymail 27 27 NATURAL JOIN wcf".WCF_N."_user user 28 WHERE groupID = '".intval($eventObj->group->groupID)."'"; 28 WHERE groupID = ".intval($eventObj->group->groupID)." 29 AND emailNotification = 1"; 29 30 $result = WCF::getDB()->sendQuery($sql); 30 31 while ($row = WCF::getDB()->fetchArray($result)) { -
application.register/templates/userGroupApplyMail.tpl
r276 r292 3 3 <legend>{lang}wcf.groupapplymail.options{/lang}</legend> 4 4 5 <div class="formCheckBox formElement" id="enableGroupApplyMailDiv"> 5 <div class="formCheckBox formElement"> 6 <div class="formField"> 7 <label for="enableGroupApplyMailDisplay"><input id="enableGroupApplyMailDisplay" type="checkbox" name="groupApplyMail_display" value="1" 8 {if $display}checked="checked"{/if}/> {lang}wcf.groupapplymail.enableDisplayNotification.{$groupType}{/lang}</label> 9 </div> 6 10 11 <div class="formFieldDesc"> 12 <p>{lang}wcf.groupapplymail.enableDisplayNotification.{$groupType}.description{/lang}</p> 13 </div> 14 </div> 15 16 <div class="formCheckBox formElement"> 7 17 <div class="formField"> 8 <label for="enableGroupApplyMail "><input id="enableGroupApplyMail" type="checkbox" name="groupApplyMail_enabled" value="1"9 {if $e nabled}checked="checked"{/if}/> {lang}wcf.groupapplymail.enableEmailNotification.{$groupType}{/lang}</label>18 <label for="enableGroupApplyMailEmail"><input id="enableGroupApplyMailEmail" type="checkbox" name="groupApplyMail_email" value="1" 19 {if $email}checked="checked"{/if}/> {lang}wcf.groupapplymail.enableEmailNotification.{$groupType}{/lang}</label> 10 20 </div> 11 21
