Preorder: Status can now be changed manually
This commit is contained in:
@@ -65,6 +65,44 @@ class Voiceplan extends mfBaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
public function importZonesFromCsv(File $file) {
|
||||
if(!$this->id) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
$i = 0;
|
||||
$filename = $file->getFullPath();
|
||||
$input = fopen($filename, "r");
|
||||
while($csv = fgetcsv($input, 0, ",")) {
|
||||
$i++;
|
||||
if($i == 1) continue;
|
||||
|
||||
if(!trim($csv[0])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = trim($csv[0]);
|
||||
$prefix = trim($csv[1]);
|
||||
$price_ek = str_replace(",",".", trim($csv[2]));
|
||||
$price_vk = str_replace(",",".", trim($csv[3]));
|
||||
|
||||
if(!$name || !$prefix || !$price_ek || !$price_vk) {
|
||||
$this->log->warning("not Importing Voiceplandestination with empty value: destination: $name | prefix: $prefix | ek: $price_ek | vk: $price_vk");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
} catch(Exception $e) {
|
||||
echo $e->getCode().": ".$e->getMessage();exit;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getProperty($name) {
|
||||
if($this->$name == null) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user