Merge branch 'fronkdev' into 'master'

ConstructionConsent Changes

See merge request fronk/thetool!1022
This commit is contained in:
Frank Schubert
2025-02-13 13:36:53 +00:00
9 changed files with 313 additions and 159 deletions

View File

@@ -80,7 +80,8 @@ class ConstructionConsent extends mfBaseModel {
$pdf = new PdfForm("ConstructionConsent/Consentform.pdf", $pdf_vars);
$wkOpts = "--footer-center '$footer_text' --footer-font-name '$footer_font' --footer-font-size '$footer_size'";
//$wkOpts = "--footer-center '$footer_text' --footer-font-name '$footer_font' --footer-font-size '$footer_size'";
$wkOpts = "--footer-html '".$_SERVER["HTTP_HOST"].MFFANCYBASEURL."/assets/pdf/ConstructionConsent/Consentform.footer.html' --margin-bottom 15mm --margin-top 10mm";
$filename = $pdf->render($wkOpts);
if(!file_exists($filename) || !is_file($filename)) {

View File

@@ -217,6 +217,14 @@ class ConstructionConsentController extends mfBaseController {
$data["usage_manhole"] = $r->usage_manhole ? 1 : 0;
$data["usage_owner"] = $r->usage_owner ? 1 : 0;
if($r->object_type == "street") {
$data["usage_length"] = 1;
$data["usage_pipe_on_plot"] = 1;
$data["usage_pipe_in_building"] = 1;
$data["usage_manhole"] = 1;
$data["usage_owner"] = 1;
}
if($mode == "add") {
$item = ConstructionConsent::create($data);
} else {

View File

@@ -90,8 +90,8 @@ class ConstructionConsentOwner extends mfBaseModel {
$model = new ConstructionConsentOwner();
$table_fields = [
"constructionconsent_id", "name", "street", "zip", "city", "country", "phone",
"fax", "email", "status", "result", "create_by","edit_by","create","edit"
"constructionconsent_id", "title", "firstname", "lastname", "street", "zip", "city", "country",
"phone", "phone2", "fax", "email", "status", "result", "create_by","edit_by","create","edit"
];
foreach($data as $field => $value) {
@@ -118,7 +118,7 @@ class ConstructionConsentOwner extends mfBaseModel {
$db = FronkDB::singleton();
$res = $db->select("ConstructionConsentOwner", "*", "1 = 1 ORDER BY name");
$res = $db->select("ConstructionConsentOwner", "*", "1 = 1 ORDER BY lastname,firstname");
if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) {
$items[] = new ConstructionConsentOwner($data);
@@ -134,7 +134,7 @@ class ConstructionConsentOwner extends mfBaseModel {
$where = self::getSqlFilter($filter);
$sql = "SELECT * FROM ConstructionConsentOwner
WHERE $where
ORDER BY name LIMIT 1";
ORDER BY lastname,firstname LIMIT 1";
//var_dump($sql);exit;
$res = $db->query($sql);
if($db->num_rows($res)) {
@@ -171,7 +171,7 @@ class ConstructionConsentOwner extends mfBaseModel {
$items = [];
if(!$order) {
$order = "name ASC";
$order = "lastname,firstname ASC";
}
$db = FronkDB::singleton();

View File

@@ -78,12 +78,15 @@ class ConstructionConsentOwnerController extends mfBaseController
$data = [];
$data["constructionconsent_id"] = $cc_id;
$data["name"] = $r->name;
$data["title"] = $r->title;
$data["firstname"] = $r->firstname;
$data["lastname"] = $r->lastname;
$data["street"] = $r->street;
$data["zip"] = $r->zip;
$data["city"] = $r->city;
$data["country"] = $r->country;
$data["phone"] = $r->phone;
$data["phone2"] = $r->phone2;
$data["fax"] = $r->fax;
$data["email"] = $r->email;

View File

@@ -17,6 +17,15 @@ class File extends mfBaseModel {
$this->mimetype = $this->getMimetype();
}
public function fileExists() {
if(!$this->store_filename) return false;
$path = MFUPLOAD_FILE_SAVE_PATH;
$path .= ($this->subfolder) ? "/".$this->subfolder : "";
$path .= "/".$this->store_filename;
return file_exists($path);
}
public function getMimetype() {
if(!$this->store_filename) return false;