Changeset 57344
- Timestamp:
- 03/07/08 16:38:52 (2 months ago)
- Location:
- modules/marketdemandmap/trunk
- Files:
-
- 6 modified
-
code/controller/DemandMap.php (modified) (1 diff)
-
code/model/Supplier.php (modified) (1 diff)
-
code/model/SupplierNetwork.php (modified) (2 diffs)
-
code/model/SupplyShape.php (modified) (1 diff)
-
javascript/demandmap.SupplierControl.js (modified) (2 diffs)
-
templates/Includes/DemandSupplierControl_Suppliers.ss (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
modules/marketdemandmap/trunk/code/controller/DemandMap.php
r57336 r57344 284 284 ), 285 285 new LiteralField('SupplierControl', $this->customise(array( 286 'PublicSupplier s' => Supplier::get_public()286 'PublicSupplierNetworks' => SupplierNetwork::get_public() 287 287 ))->renderWith('DemandSupplierControl_Suppliers')) 288 288 ); -
modules/marketdemandmap/trunk/code/model/Supplier.php
r56910 r57344 40 40 return $this->SupplierNetworks('HideFromPublic = 0'); 41 41 } 42 42 43 43 /** 44 44 * @param string $SQL_filter -
modules/marketdemandmap/trunk/code/model/SupplierNetwork.php
r57014 r57344 116 116 function getCombinedTitle() { 117 117 $supplierTitle = $this->Supplier()->Title; 118 return "{$ this->Title} ({$supplierTitle})";118 return "{$supplierTitle}: {$this->Title}"; 119 119 } 120 120 … … 135 135 } 136 136 137 /** 138 * @param string $SQL_filter 139 */ 140 public static function get_public($SQL_filter = null) { 141 $SQL_combinedFilter = 'Supplier.HideFromPublic = 0 AND SupplierNetwork.HideFromPublic = 0'; 142 if($SQL_filter) $SQL_combinedFilter .= ' AND ' . Convert::raw2sql($SQL_filter); 143 return DataObject::get( 144 'SupplierNetwork', 145 $SQL_combinedFilter, 146 'Supplier.Title, SupplierNetwork.Title', 147 'LEFT JOIN Supplier ON SupplierNetwork.SupplierID = Supplier.ID' 148 ); 149 } 150 137 151 } 138 152 ?> -
modules/marketdemandmap/trunk/code/model/SupplyShape.php
r57014 r57344 57 57 58 58 public function generatetile($request) { 59 // DEBUG 60 return false; 61 59 62 $RAW_filename = $_GET['tile']; // escaped in TileRenderer 60 63 -
modules/marketdemandmap/trunk/javascript/demandmap.SupplierControl.js
r56952 r57344 29 29 $('.Actions .loadingIndicator', container).hide(); 30 30 31 // hide all single subcategories32 $('.supplierList li.category', container).each(function() {33 var subcategoryNodes = $('li.subcategory', this);34 if(subcategoryNodes.length < 2) {35 subcategoryNodes.hide();36 } else {37 // hide colors on main category (displayed on subcategories now)38 $(this).find('label .color').hide();39 $(this).find('ul label .color').show();40 }41 });42 43 31 // events 44 $('.supplierList .category :checkbox', container).bind('click', function(e) { 45 // @todo avoid multiple "too many selections" popup coming up 46 var categoryChecked = (e.target.checked); 47 $('.subcategory :checkbox', this.parentNode).each(function() { 48 this.checked = (categoryChecked) ? 'checked' : ''; 49 $(this).click(); 50 }); 51 }); 52 $('.supplierList .subcategory :checkbox', container).bind('click', function(e) { 53 if($('.supplierList .subcategory :checked', container).length > options.maxNetworkSelections) { 32 $('.supplierList :checkbox', container).bind('click', function(e) { 33 // count all already selected checkboxes 34 if($('.supplierList :checked', container).length > options.maxNetworkSelections) { 54 35 alert($.i18n._t('MAXSUPPLIERSELECTIONS')); 55 36 e.target.checked = ''; 56 37 return false; 57 38 } 39 40 // make sure radiobutton "show netowkrs" is selected 41 $(':radio[value=select networks]', container).click(); 42 58 43 var supplierID = e.target.value; 59 44 if(e.target.checked) { … … 68 53 return true; 69 54 }); 55 70 56 // "show coverage" (toggling of all layers with fake ID '0') 71 57 // radiobutton selection: either "show coverage" or "select networks" -
modules/marketdemandmap/trunk/templates/Includes/DemandSupplierControl_Suppliers.ss
r57337 r57344 13 13 <div class="supplierList"> 14 14 <ul> 15 <% control PublicSuppliers %> 16 <li id="Supplier$ID" class="category"> 17 <input type="checkbox" name="Suppliers[]" id="SupplierID_$ID" value="$ID" class="checkbox category" /> 18 <label for="SupplierID_$ID"> 19 <% control PublicSupplierNetworks %> 20 <span class="color" style="background-color: $LayerColor;"> </span> 21 <% end_control %> 22 $Title 23 </label> 24 <% if SupplierNetworks %> 25 <ul> 26 <% control PublicSupplierNetworks %> 27 <li id="SupplierNetwork$ID" class="subcategory $JSONData"> 28 <input type="checkbox" name="SupplierNetworks[]" id="SupplierNetworkID_$ID" value="$ID" class="checkbox subcategory" /> 29 <label for="SupplierNetworkID_$ID"> 30 <span class="color" style="background-color: $LayerColor;"> </span>$Title 31 </label> 32 </li> 33 <% end_control %> 34 </ul> 35 <% end_if %> 36 </li> 37 <% end_control %> 15 <% control PublicSupplierNetworks %> 16 <li id="Supplier$ID" class="category"> 17 <input type="checkbox" name="Suppliers[]" id="SupplierID_$ID" value="$ID" class="checkbox category" /> 18 <label for="SupplierID_$ID"> 19 <span class="color" style="background-color: $LayerColor;"> </span> 20 $CombinedTitle 21 </label> 22 </li> 23 <% end_control %> 38 24 </ul> 39 25 <p class="message"><small>Max. 3 suppliers</small></p>
