adjustmentsSuccess.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. define('RENDER_MODE', 'catalyz');
  3. $node = $page->getNode();
  4. use_helper('Form');
  5. $properties = array();
  6. $properties['page'] = $page;
  7. $properties['node'] = $node;
  8. $properties['ContentTree'] = $ContentTree;
  9. ob_start();
  10. use_helper('I18N');
  11. $allLanguages = sfConfig::get('app_translations_available_languages');
  12. $default = sfConfig::get('app_translations_default_language');
  13. // $existing_languages = $node->getAvailableTranslations();
  14. $allLanguages = Catalyz::getAllTranslations();
  15. unset($allLanguages[$default]);
  16. // $perms = array();
  17. // $available_languages = array();
  18. // foreach($allLanguages as $iso => $name) {
  19. // if (!isset($existing_languages[$iso])) {
  20. // $available_languages[$iso] = ucfirst($name);
  21. // }
  22. // $perms[$iso]['edit'] = true;
  23. // $perms[$iso]['delete'] = ($iso != $default);
  24. // }
  25. // include_partial('catalyz/header');
  26. ?>
  27. <div class="content-add01">
  28. <?php $categories = array() ?>
  29. <?php foreach(KataoProductCategoryPeer::getAll() as $katao_product_category_id => $katao_product_category): ?>
  30. <?php $categories[$katao_product_category_id] = $katao_product_category['name'] ?>
  31. <?php endforeach ?>
  32. <?php $suppliers = array() ?>
  33. <?php $suppliers_order_min_amount = array() ?>
  34. <?php foreach(KataoSupplierPeer::getAllJoinCart() as $katao_supplier_id => $katao_supplier): ?>
  35. <?php $suppliers[$katao_supplier_id] = $katao_supplier['name'] ?>
  36. <?php $suppliers_order_min_amount[$katao_supplier_id] = $katao_supplier['order_min_amount'] ?>
  37. <?php endforeach ?>
  38. <?php echo form_tag('@katao_ajustements') ?>
  39. <br />Rayon : <?php echo select_tag('category_id', options_for_select($categories, $default_category_id, array('include_custom' => '&mdash;&nbsp;tous&nbsp;&mdash;'))) ?>
  40. <br /><br />Fournisseur : <?php echo select_tag('supplier_id', options_for_select($suppliers, $default_supplier_id, array('include_custom' => '&mdash;&nbsp;tous&nbsp;&mdash;'))) ?>
  41. <?php if ($default_supplier_id && !empty($suppliers_order_min_amount[$default_supplier_id])): ?>
  42. <?php $total_order_supplier = KataoCartPeer::sumForSupplier($default_supplier_id) ?>
  43. <br /><?php echo image_tag(($total_order_supplier < $suppliers_order_min_amount[$default_supplier_id])?'actions/bullet_red.png':'actions/bullet_green.png', array('align' => 'top', 'title' => '')) ?>Total commandes adhérents : <b><?php echo Utils::formatCurrencyEuro($total_order_supplier) ?></b> / Minimum fournisseur : <b><?php echo Utils::formatCurrencyEuro($suppliers_order_min_amount[$default_supplier_id]) ?></b>
  44. <?php endif ?>
  45. <br /><br /><?php echo submit_tag('Voir les produits') ?>
  46. </form>
  47. <br><br /><div class="heading01"><h1>Produits dont le colisage est incomplet </h1></div>
  48. <?php if ($default_category_id || $default_supplier_id): ?>
  49. <?php include_partial('katao/products', array('pager' => KataoProductPeer::getPagerForAll($default_category_id, $default_supplier_id), 'url' => '', 'katao_product_category' => '', 'katao_product_family' => '')) ?>
  50. <?php else: ?>
  51. <p><i>Merci de sélectionner un rayon et/ou un fournisseur ci-dessus.</i></p>
  52. <?php endif ?>
  53. </div>
  54. <?php
  55. $content = ob_get_contents();
  56. ob_end_clean();
  57. // $layout = LayoutManager::instance()->getCatalyzTemplate($ContentTreeNode->getCurrentLayoutNameForAction());
  58. $properties['layout_family'] = 'katao';
  59. $properties['layout_name'] = 'default';
  60. $properties['content'] = $content;
  61. include_component($properties['layout_family'], $properties['layout_name'], $properties);
  62. ?>