From d007fbab2433ef3e8f40995bacc0eec2a68f960e Mon Sep 17 00:00:00 2001 From: SirCotare Date: Thu, 14 Jun 2012 11:23:52 +0200 Subject: [PATCH] #1470 added dev flags --- .../class/AchAchievement_class.php | 6 +++++ .../class/AchCategory_class.php | 20 +++++++++++++++-- .../app_achievements/class/AchMenu_class.php | 5 +++++ .../app_achievements/class/AchPerk_class.php | 6 +++++ .../class/AchSummary_class.php | 4 ++-- .../include/ach_render_ig.php | 22 +++++++++++++++++-- .../include/ach_render_web.php | 16 ++++++++++++++ code/web/app/app_achievements/index.php | 2 +- 8 files changed, 74 insertions(+), 7 deletions(-) diff --git a/code/web/app/app_achievements/class/AchAchievement_class.php b/code/web/app/app_achievements/class/AchAchievement_class.php index 9fc920dda..ebc52e0ca 100644 --- a/code/web/app/app_achievements/class/AchAchievement_class.php +++ b/code/web/app/app_achievements/class/AchAchievement_class.php @@ -9,6 +9,7 @@ private $image; private $name; private $template; + private $dev; function AchAchievement(&$data) { global $DBc,$_USER; @@ -22,6 +23,7 @@ $this->image = $data['aa_image']; $this->name = $data['aal_name']; $this->template = $data['aal_template']; + $this->dev = $data['aa_dev']; #echo $this->id; @@ -104,5 +106,9 @@ return $tmp; } } + + function inDev() { + return ($this->dev == 1); + } } ?> \ No newline at end of file diff --git a/code/web/app/app_achievements/class/AchCategory_class.php b/code/web/app/app_achievements/class/AchCategory_class.php index 392c2c085..b6763d61e 100644 --- a/code/web/app/app_achievements/class/AchCategory_class.php +++ b/code/web/app/app_achievements/class/AchCategory_class.php @@ -3,6 +3,8 @@ private $id = false; private $ties_cult; private $ties_civ; + private $ties_cult_dev; + private $ties_civ_dev; private $cult; private $civ; @@ -39,11 +41,17 @@ $this->nodes[] = $tmp; } - $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_cult IS NOT NULL AND aa_category='".$this->id."'"); + $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_cult IS NOT NULL AND aa_category='".$this->id."' AND aa_dev='0'"); $this->ties_cult = $res[0]['anz']; - $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_civ IS NOT NULL AND aa_category='".$this->id."'"); + $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_civ IS NOT NULL AND aa_category='".$this->id."' AND aa_dev='0'"); $this->ties_civ = $res[0]['anz']; + + $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_cult IS NOT NULL AND aa_category='".$this->id."'"); + $this->ties_cult_dev = $res[0]['anz']; + + $res = $DBc->sqlQuery("SELECT count(*) as anz FROM ach_achievement WHERE aa_tie_civ IS NOT NULL AND aa_category='".$this->id."'"); + $this->ties_civ_dev = $res[0]['anz']; } function getID() { @@ -58,6 +66,14 @@ return ($this->ties_civ > 0); } + function isTiedCultDev() { + return ($this->ties_cult_dev > 0); + } + + function isTiedCivDev() { + return ($this->ties_civ_dev > 0); + } + function getCurrentCiv() { return $this->civ; } diff --git a/code/web/app/app_achievements/class/AchMenu_class.php b/code/web/app/app_achievements/class/AchMenu_class.php index a432dbdb7..68f850452 100644 --- a/code/web/app/app_achievements/class/AchMenu_class.php +++ b/code/web/app/app_achievements/class/AchMenu_class.php @@ -55,6 +55,7 @@ $this->image = $data['ac_image']; $this->order = $data['ac_order']; $this->open = ($this->id == $open); + $this->dev = $data['ac_dev']; $res = $DBc->sqlQuery("SELECT * FROM ach_category LEFT JOIN (ach_category_lang) ON (acl_lang='".$_USER->getLang()."' AND acl_category=ac_id) WHERE ac_parent='".$this->id."' ORDER by ac_order ASC, acl_name ASC"); @@ -101,5 +102,9 @@ function getOrder() { return $this->order; } + + function inDev() { + return ($this->dev == 1); + } } ?> \ No newline at end of file diff --git a/code/web/app/app_achievements/class/AchPerk_class.php b/code/web/app/app_achievements/class/AchPerk_class.php index e6896e249..0d12c1690 100644 --- a/code/web/app/app_achievements/class/AchPerk_class.php +++ b/code/web/app/app_achievements/class/AchPerk_class.php @@ -6,6 +6,7 @@ private $value; private $name; private $done; + private $dev; function AchPerk(&$data,&$parent) { global $DBc,$_USER; @@ -16,6 +17,7 @@ $this->value = $data['ap_value']; $this->name = $data['apl_name']; $this->done = $data['app_date']; + $this->dev = $data['ap_dev']; $res = $DBc->sqlQuery("SELECT * FROM ach_objective LEFT JOIN (ach_objective_lang) ON (aol_lang='".$_USER->getLang()."' AND aol_objective=ao_id) LEFT JOIN (ach_player_objective) ON (apo_objective=ao_id AND apo_player='".$_USER->getID()."') WHERE ao_perk='".$this->id."'"); $sz = sizeof($res); @@ -60,5 +62,9 @@ function getDone() { return $this->done; } + + function inDev() { + return ($this->dev == 1); + } } ?> \ No newline at end of file diff --git a/code/web/app/app_achievements/class/AchSummary_class.php b/code/web/app/app_achievements/class/AchSummary_class.php index a89df0823..95720cec2 100644 --- a/code/web/app/app_achievements/class/AchSummary_class.php +++ b/code/web/app/app_achievements/class/AchSummary_class.php @@ -30,7 +30,7 @@ $tmp = $this->menu->getChildren(); foreach($tmp as $elem) { - if($elem->getID() == 0) { + if($elem->getID() == 0 || $elem->inDev()) { continue; // skip summary page } $res = $this->sumStats($elem); @@ -52,7 +52,7 @@ $res = $DBc->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement,ach_player_perk WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id AND app_player='".$_USER->getID()."' AND app_perk=ap_id"); $done += $res[0]["anz"]; - $res = $DBc->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id"); + $res = $DBc->sqlQuery("SELECT count(ap_id) as anz FROM ach_perk,ach_achievement WHERE aa_category='".$node->getID()."' AND ap_achievement=aa_id AND aa_dev='0' AND ap_dev='0'"); $total += $res[0]["anz"]; $tmp = $node->getChildren(); diff --git a/code/web/app/app_achievements/include/ach_render_ig.php b/code/web/app/app_achievements/include/ach_render_ig.php index 2718bfbc0..5c59935a7 100644 --- a/code/web/app/app_achievements/include/ach_render_ig.php +++ b/code/web/app/app_achievements/include/ach_render_ig.php @@ -112,6 +112,9 @@ $sz = $menu->getSize(); for($i=0;$i<$sz;$i++) { $curr = $menu->getChild($i); + if($curr->inDev()) { + continue; + } $html .= ""; if($sub == 0) { @@ -143,6 +146,9 @@ $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "A"; + if($cat->getChild($tmp[$i])->inDev()) { + continue; + } $html .= ach_render_achievement_done($cat->getChild($tmp[$i])); } @@ -150,6 +156,9 @@ $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "B"; + if($cat->getChild($tmp[$i])->inDev()) { + continue; + } $html .= ach_render_achievement_open($cat->getChild($tmp[$i])); } @@ -234,9 +243,15 @@ $perk = $ach->getChild($perk_list[0]); - $html .= "".$perk->getName().""; + if($perk->inDev()) { + return $html; + } + + if($perk->getName() != null) { + $html .= "".$perk->getName().""; + } if($perk->objDrawable()) { - $html .= "
".ach_render_obj_list($perk->getChildren()); + $html .= ach_render_obj_list($perk->getChildren()); } return $html; @@ -249,6 +264,9 @@ foreach($perk_list as $elem) { $perk = $ach->getChild($elem); + if($perk->inDev()) { + continue; + } $html .= "
".$perk->getName()." ( ".date('d.m.Y',$perk->getDone())." ) ".$perk->getValue()."
"; } diff --git a/code/web/app/app_achievements/include/ach_render_web.php b/code/web/app/app_achievements/include/ach_render_web.php index 7ab64ecd5..5c59935a7 100644 --- a/code/web/app/app_achievements/include/ach_render_web.php +++ b/code/web/app/app_achievements/include/ach_render_web.php @@ -112,6 +112,9 @@ $sz = $menu->getSize(); for($i=0;$i<$sz;$i++) { $curr = $menu->getChild($i); + if($curr->inDev()) { + continue; + } $html .= "
"; if($sub == 0) { @@ -143,6 +146,9 @@ $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "A"; + if($cat->getChild($tmp[$i])->inDev()) { + continue; + } $html .= ach_render_achievement_done($cat->getChild($tmp[$i])); } @@ -150,6 +156,9 @@ $sz = sizeof($tmp); for($i=0;$i<$sz;$i++) { #echo "B"; + if($cat->getChild($tmp[$i])->inDev()) { + continue; + } $html .= ach_render_achievement_open($cat->getChild($tmp[$i])); } @@ -233,6 +242,10 @@ $perk_list = $ach->getOpen(); $perk = $ach->getChild($perk_list[0]); + + if($perk->inDev()) { + return $html; + } if($perk->getName() != null) { $html .= "".$perk->getName().""; @@ -251,6 +264,9 @@ foreach($perk_list as $elem) { $perk = $ach->getChild($elem); + if($perk->inDev()) { + continue; + } $html .= "
".$perk->getName()." ( ".date('d.m.Y',$perk->getDone())." ) ".$perk->getValue()."
"; } diff --git a/code/web/app/app_achievements/index.php b/code/web/app/app_achievements/index.php index 6837c0cc6..a13db6659 100644 --- a/code/web/app/app_achievements/index.php +++ b/code/web/app/app_achievements/index.php @@ -63,7 +63,7 @@ $c = _t('access', $num_access['num_access']).'
';*/ $c = "
- +
".ach_render_yubopoints(1)."".ach_render_yubopoints(1)."
";