Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.77 KB | None | 0 0
  1. diff --git a/apps/backend/modules/config/actions/actions.class.php b/apps/backend/modules/config/actions/actions.class.php
  2. index 91a7a97..94cacda 100644
  3. --- a/apps/backend/modules/config/actions/actions.class.php
  4. +++ b/apps/backend/modules/config/actions/actions.class.php
  5. @@ -4,11 +4,31 @@ class configActions extends sfActions
  6. {
  7. public function executeIndex(sfWebRequest $request)
  8. {
  9. + $c = new Criteria;
  10. + $c->add(ConfigurationPeer::NAME, "dealbox");
  11. + $this->dealbox = ConfigurationPeer::doSelectOne($c);
  12. +
  13. + $c = new Criteria;
  14. + $c->add(ConfigurationPeer::NAME, "wallet");
  15. + $this->wallet = ConfigurationPeer::doSelectOne($c);
  16. +
  17. if ($request->isMethod('post'))
  18. {
  19. if ($request->hasParameter("pap_auto"))
  20. PapConfig::setAuto($request->getParameter("pap_auto"));
  21.  
  22. + if ($request->hasParameter("dealbox"))
  23. + {
  24. + $this->dealbox->setValue($request->getParameter("dealbox"));
  25. + $this->dealbox->save();
  26. + }
  27. +
  28. + if ($request->hasParameter("wallet"))
  29. + {
  30. + $this->wallet->setValue($request->getParameter("wallet"));
  31. + $this->wallet->save();
  32. + }
  33. +
  34. $this->redirect("config/index");
  35. }
  36.  
  37. diff --git a/apps/backend/modules/config/templates/indexSuccess.php b/apps/backend/modules/config/templates/indexSuccess.php
  38. index fda2424..5376066 100644
  39. --- a/apps/backend/modules/config/templates/indexSuccess.php
  40. +++ b/apps/backend/modules/config/templates/indexSuccess.php
  41. @@ -8,4 +8,24 @@ PAP automagic:
  42. <?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?pap_auto=1", "post=true class=link"); ?>]
  43. <?php endif; ?>
  44. </h2>
  45. +
  46. +<h2>
  47. +Dealbox:
  48. +<?php if ($dealbox->getValue() == "1"): ?>
  49. +<?php echo __("on") ?> [<?php echo link_to(__("turn off"), "config/index?dealbox=0", "post=true class=link"); ?>]
  50. +<?php else: ?>
  51. +<?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?dealbox=1", "post=true class=link"); ?>]
  52. +<?php endif; ?>
  53. +</h2>
  54. +
  55. +<h2>
  56. +Portfel:
  57. +<?php if ($wallet->getValue() == "1"): ?>
  58. +<?php echo __("on") ?> [<?php echo link_to(__("turn off"), "config/index?wallet=0", "post=true class=link"); ?>]
  59. +<?php else: ?>
  60. +<?php echo __("off") ?> [<?php echo link_to(__("turn on"), "config/index?wallet=1", "post=true class=link"); ?>]
  61. +<?php endif; ?>
  62. +</h2>
  63. +
  64. +
  65. <?php nice_box_end(); ?>
  66. diff --git a/apps/frontend/modules/news/actions/actions.class.php b/apps/frontend/modules/news/actions/actions.class.php
  67. index d125adb..57afaf8 100644
  68. --- a/apps/frontend/modules/news/actions/actions.class.php
  69. +++ b/apps/frontend/modules/news/actions/actions.class.php
  70. @@ -92,6 +92,14 @@ class newsActions extends SectionActions
  71. $c = new Criteria;
  72. $c->add(TrainingAppointmentPeer::HOMEPAGE, true);
  73. $this->appointments = TrainingAppointmentPeer::cleverRetrieve($c);
  74. +
  75. + $c = new Criteria;
  76. + $c->add(ConfigurationPeer::NAME, "dealbox");
  77. + $this->conf_dealbox = ConfigurationPeer::doSelectOne($c);
  78. +
  79. + $c = new Criteria;
  80. + $c->add(ConfigurationPeer::NAME, "wallet");
  81. + $this->conf_wallet = ConfigurationPeer::doSelectOne($c);
  82. }
  83.  
  84. public function executeRecommend(sfWebRequest $request)
  85. diff --git a/apps/frontend/modules/news/templates/homepageSuccess.php b/apps/frontend/modules/news/templates/homepageSuccess.php
  86. index b7d394e..82f67ad 100644
  87. --- a/apps/frontend/modules/news/templates/homepageSuccess.php
  88. +++ b/apps/frontend/modules/news/templates/homepageSuccess.php
  89. @@ -129,7 +129,7 @@
  90. </div>
  91. <?php endif; ?>
  92.  
  93. - <?php if ($wallet_piece): ?>
  94. + <?php if ($wallet_piece and $conf_wallet->getValue() == "1"): ?>
  95. <?php nice_box("PORTFEL"); ?>
  96. <ul><li>
  97. <?php echo link_to($wallet_piece->getName(), $wallet_piece->toUrl(), 'class=title'); ?>
  98. @@ -204,7 +204,7 @@
  99. <?php end_slot() ?>
  100.  
  101. <?php slot('rightbar_middle_top'); ?>
  102. - <?php if ($hindsights): ?>
  103. + <?php if ($hindsights and $conf_dealbox->getValue() == "1"): ?>
  104. <?php nice_box_newsroom("DEALBOX", true) ?>
  105. <?php include_partial("analyses/dealbox", array('hindsights' => $hindsights)); ?>
  106. <div style="text-align: right; margin-bottom: 5px;">
  107. diff --git a/config/schema.yml b/config/schema.yml
  108. index 314edb9..c86b10e 100644
  109. --- a/config/schema.yml
  110. +++ b/config/schema.yml
  111. @@ -440,3 +440,10 @@ main:
  112. url: { type: varchar(300) }
  113. begin: { type: timestamp, required: true }
  114. end: { type: timestamp, required: true }
  115. +
  116. + configurations:
  117. + _attributes: { phpName: Configuration }
  118. + id:
  119. + name: { type: varchar(100), required: true }
  120. + value: { type: varchar(100) }
  121. +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement