| @@ 10-76 (lines=67) @@ | ||
| 7 | * @inspiration: Silverstripe Ltd, Jeremy |
|
| 8 | **/ |
|
| 9 | ||
| 10 | class StockistsCountryReports_WithoutCountry extends SS_Report |
|
| 11 | { |
|
| 12 | ||
| 13 | /** |
|
| 14 | * The class of object being managed by this report. |
|
| 15 | * Set by overriding in your subclass. |
|
| 16 | */ |
|
| 17 | protected $dataClass = 'StockistCountryPage'; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * |
|
| 21 | * @return String |
|
| 22 | */ |
|
| 23 | public function title() |
|
| 24 | { |
|
| 25 | return "STOCKISTS: stockist countries without a country (".$this->sourceRecords()->count().")"; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * not sure if this is used in SS3 |
|
| 30 | * @return String |
|
| 31 | */ |
|
| 32 | public function group() |
|
| 33 | { |
|
| 34 | return "Stockists"; |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * |
|
| 39 | * @return INT - for sorting reports |
|
| 40 | */ |
|
| 41 | public function sort() |
|
| 42 | { |
|
| 43 | return 9000; |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * working out the items |
|
| 48 | * @return DataList |
|
| 49 | */ |
|
| 50 | public function sourceRecords($params = null) |
|
| 51 | { |
|
| 52 | return StockistCountryPage::get()->where("Country = '' OR Country IS NULL"); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return Array |
|
| 57 | */ |
|
| 58 | public function columns() |
|
| 59 | { |
|
| 60 | return array( |
|
| 61 | "Title" => array( |
|
| 62 | "title" => "FullName", |
|
| 63 | "link" => true |
|
| 64 | ) |
|
| 65 | ); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * |
|
| 70 | * @return FieldList |
|
| 71 | */ |
|
| 72 | public function getParameterFields() |
|
| 73 | { |
|
| 74 | return new FieldList(); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| @@ 10-76 (lines=67) @@ | ||
| 7 | * @inspiration: Silverstripe Ltd, Jeremy |
|
| 8 | **/ |
|
| 9 | ||
| 10 | class StockistsReport_WithoutAPicture extends SS_Report |
|
| 11 | { |
|
| 12 | ||
| 13 | /** |
|
| 14 | * The class of object being managed by this report. |
|
| 15 | * Set by overriding in your subclass. |
|
| 16 | */ |
|
| 17 | protected $dataClass = 'StockistPage'; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * |
|
| 21 | * @return String |
|
| 22 | */ |
|
| 23 | public function title() |
|
| 24 | { |
|
| 25 | return "STOCKISTS: without a picture (".$this->sourceRecords()->count().")"; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * not sure if this is used in SS3 |
|
| 30 | * @return String |
|
| 31 | */ |
|
| 32 | public function group() |
|
| 33 | { |
|
| 34 | return "Stockists"; |
|
| 35 | } |
|
| 36 | ||
| 37 | /** |
|
| 38 | * |
|
| 39 | * @return INT - for sorting reports |
|
| 40 | */ |
|
| 41 | public function sort() |
|
| 42 | { |
|
| 43 | return 9000; |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * working out the items |
|
| 48 | * @return DataList |
|
| 49 | */ |
|
| 50 | public function sourceRecords($params = null) |
|
| 51 | { |
|
| 52 | return StockistPage::get()->filter(array("ImageID" => 0)); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return Array |
|
| 57 | */ |
|
| 58 | public function columns() |
|
| 59 | { |
|
| 60 | return array( |
|
| 61 | "Title" => array( |
|
| 62 | "title" => "FullName", |
|
| 63 | "link" => true |
|
| 64 | ) |
|
| 65 | ); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * |
|
| 70 | * @return FieldList |
|
| 71 | */ |
|
| 72 | public function getParameterFields() |
|
| 73 | { |
|
| 74 | return new FieldList(); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | class StockistsReport_WithoutALogo extends SS_Report |
|
| 79 | { |
|
| @@ 78-144 (lines=67) @@ | ||
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | class StockistsReport_WithoutALogo extends SS_Report |
|
| 79 | { |
|
| 80 | ||
| 81 | /** |
|
| 82 | * The class of object being managed by this report. |
|
| 83 | * Set by overriding in your subclass. |
|
| 84 | */ |
|
| 85 | protected $dataClass = 'StockistPage'; |
|
| 86 | ||
| 87 | /** |
|
| 88 | * |
|
| 89 | * @return String |
|
| 90 | */ |
|
| 91 | public function title() |
|
| 92 | { |
|
| 93 | return "STOCKISTS: without a logo (".$this->sourceRecords()->count().")"; |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * not sure if this is used in SS3 |
|
| 98 | * @return String |
|
| 99 | */ |
|
| 100 | public function group() |
|
| 101 | { |
|
| 102 | return "Stockists"; |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * |
|
| 107 | * @return INT - for sorting reports |
|
| 108 | */ |
|
| 109 | public function sort() |
|
| 110 | { |
|
| 111 | return 9000; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * working out the items |
|
| 116 | * @return DataList |
|
| 117 | */ |
|
| 118 | public function sourceRecords($params = null) |
|
| 119 | { |
|
| 120 | return StockistPage::get()->filter(array("LogoID" => 0)); |
|
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * @return Array |
|
| 125 | */ |
|
| 126 | public function columns() |
|
| 127 | { |
|
| 128 | return array( |
|
| 129 | "Title" => array( |
|
| 130 | "title" => "FullName", |
|
| 131 | "link" => true |
|
| 132 | ) |
|
| 133 | ); |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * |
|
| 138 | * @return FieldList |
|
| 139 | */ |
|
| 140 | public function getParameterFields() |
|
| 141 | { |
|
| 142 | return new FieldList(); |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | class StockistsReport_WithoutAnAddress extends SS_Report |
|
| 147 | { |
|
| @@ 220-286 (lines=67) @@ | ||
| 217 | } |
|
| 218 | ||
| 219 | ||
| 220 | class StockistsReport_OnlineStockists extends SS_Report |
|
| 221 | { |
|
| 222 | ||
| 223 | /** |
|
| 224 | * The class of object being managed by this report. |
|
| 225 | * Set by overriding in your subclass. |
|
| 226 | */ |
|
| 227 | protected $dataClass = 'StockistPage'; |
|
| 228 | ||
| 229 | /** |
|
| 230 | * |
|
| 231 | * @return String |
|
| 232 | */ |
|
| 233 | public function title() |
|
| 234 | { |
|
| 235 | return "STOCKISTS: has online store (".$this->sourceRecords()->count().")"; |
|
| 236 | } |
|
| 237 | ||
| 238 | /** |
|
| 239 | * not sure if this is used in SS3 |
|
| 240 | * @return String |
|
| 241 | */ |
|
| 242 | public function group() |
|
| 243 | { |
|
| 244 | return "Stockists"; |
|
| 245 | } |
|
| 246 | ||
| 247 | /** |
|
| 248 | * |
|
| 249 | * @return INT - for sorting reports |
|
| 250 | */ |
|
| 251 | public function sort() |
|
| 252 | { |
|
| 253 | return 9000; |
|
| 254 | } |
|
| 255 | ||
| 256 | /** |
|
| 257 | * working out the items |
|
| 258 | * @return DataList |
|
| 259 | */ |
|
| 260 | public function sourceRecords($params = null) |
|
| 261 | { |
|
| 262 | return StockistPage::get()->filter(array("HasWebStore" => 1)); |
|
| 263 | } |
|
| 264 | ||
| 265 | /** |
|
| 266 | * @return Array |
|
| 267 | */ |
|
| 268 | public function columns() |
|
| 269 | { |
|
| 270 | return array( |
|
| 271 | "Title" => array( |
|
| 272 | "title" => "FullName", |
|
| 273 | "link" => true |
|
| 274 | ) |
|
| 275 | ); |
|
| 276 | } |
|
| 277 | ||
| 278 | /** |
|
| 279 | * |
|
| 280 | * @return FieldList |
|
| 281 | */ |
|
| 282 | public function getParameterFields() |
|
| 283 | { |
|
| 284 | return new FieldList(); |
|
| 285 | } |
|
| 286 | } |
|
| 287 | ||