-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from OnePlc/childmodel
Childmodel + sql changes
- Loading branch information
Showing
12 changed files
with
162 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
ALTER TABLE `contact` ADD `description` TEXT NOT NULL DEFAULT '' AFTER `label`, | ||
ADD `firstname` VARCHAR(255) NOT NULL DEFAULT '' AFTER `description`, | ||
ADD `lastname` VARCHAR(255) NOT NULL DEFAULT '' AFTER `firstname`, | ||
ADD `email_addr` VARCHAR(255) NOT NULL DEFAULT '' AFTER `lastname`, | ||
ADD `phone` VARCHAR(20) NOT NULL DEFAULT '' AFTER `email_addr`, | ||
ADD `featured_image` VARCHAR(255) NOT NULL DEFAULT '' AFTER `phone`, | ||
ADD `email_private` VARCHAR(255) NOT NULL DEFAULT '' AFTER `lastname`, | ||
ADD `phone_private` VARCHAR(20) NOT NULL DEFAULT '' AFTER `email_private`, | ||
ADD `featured_image` VARCHAR(255) NOT NULL DEFAULT '' AFTER `phone_private`, | ||
ADD `salutation_idfs` INT(11) NOT NULL DEFAULT '0' AFTER `featured_image`, | ||
ADD `title_idfs` INT(11) NOT NULL DEFAULT '0' AFTER `salutation_idfs`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* Contact.php - Contact Entity | ||
* | ||
* Entity Model for Contact | ||
* | ||
* @category Model | ||
* @package Contact | ||
* @author Verein onePlace | ||
* @copyright (C) 2020 Verein onePlace <[email protected]> | ||
* @license https://opensource.org/licenses/BSD-3-Clause | ||
* @version 1.0.0 | ||
* @since 1.0.0 | ||
*/ | ||
|
||
namespace OnePlace\Contact\Model; | ||
|
||
class ChildContact extends Contact | ||
{ | ||
/** | ||
* Contact constructor. | ||
* | ||
* @param AdapterInterface $oDbAdapter | ||
* @since 1.0.0 | ||
*/ | ||
public function __construct($oDbAdapter) { | ||
parent::__construct($oDbAdapter); | ||
} | ||
|
||
/** | ||
* Set Entity Data based on Data given | ||
* | ||
* @param array $aData | ||
* @since 1.0.0 | ||
*/ | ||
public function exchangeArray(array $aData) { | ||
if(empty($aData['label'])) | ||
$aData['label']=$aData['firstname'].' '.$aData['lastname']; | ||
|
||
$this->id = !empty($aData['Contact_ID']) ? $aData['Contact_ID'] : 0; | ||
$this->label = !empty($aData['label']) ? $aData['label'] : ''; | ||
$this->updateDynamicFields($aData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,35 @@ | ||
<div class="card"> | ||
<div class="card-header"> | ||
<?= $this->partial('partial/indexheader',['sTitle'=>'Contacts']) ?> | ||
<div class="row"> | ||
<div class="col-md-10"> | ||
<?= $this->partial('partial/indexheader',['sTitle'=>'Contacts']) ?> | ||
</div> | ||
<div class="col-md-2 text-right"> | ||
<select class="form-control"> | ||
<option>-- <?=$this->translate('All')?> --</option> | ||
<?php | ||
if (count($aSavedSearches) > 0) { | ||
foreach($aSavedSearches as $oSearch) { ?> | ||
<option value="<?=$oSearch->Search_ID?>"> | ||
<?=$oSearch->label?> | ||
</option> | ||
<?php | ||
} | ||
} | ||
?> | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="card-body py-0"> | ||
<?= $this->partial('partial/indextable', ['sTableName'=>$sTableName,'aItems'=>$aItems]); ?> | ||
<?= $this->partial('partial/indextable', [ | ||
'sTableName' => $sTableName, | ||
'aItems' => $aItems, | ||
'aFilters' => $aFilters, | ||
'sRoute' => $sRoute | ||
]); ?> | ||
</div> | ||
<div class="card-footer"> | ||
<?= $this->partial('partial/indexpager', ['aItems'=>$aItems,'sRoute'=>(isset($sRoute)) ? $sRoute : explode('-',$sTableName)[0]]); ?> | ||
<?= $this->partial('partial/indexpager', ['aItems'=>$aItems,'sRoute'=>$sRoute]); ?> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,70 @@ | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2>Find Contact</h2> | ||
</div> | ||
<?php if(isset($aResults)) { ?> | ||
|
||
<?php } else { ?> | ||
<form action="" method="post"> | ||
<div class="card-body"> | ||
<?= $this->partial('partial/basictabs', ['sFormName'=>$this->sFormName]); ?> | ||
<?= $this->partial('partial/searchtabcontents', ['sFormName'=>$this->sFormName]); ?> | ||
</div> | ||
<div class="card-footer"> | ||
<button class="btn btn-primary" type="submit"> | ||
Start Search | ||
</button> | ||
</div> | ||
</form> | ||
<?php } ?> | ||
<?php | ||
if(isset($sTableName)) { | ||
$sRoute = (isset($sRoute)) ? $sRoute : explode('-',$sTableName)[0]; | ||
?> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<?= $this->partial('partial/indexheader',['sTitle'=>'Contacts']) ?> | ||
</div> | ||
<div class="card-body py-0"> | ||
<?= $this->partial('partial/indextable', [ | ||
'sTableName' => $sTableName, | ||
'aItems' => $aItems, | ||
'aFilters' => $aFilters, | ||
'sRoute' => $sRoute | ||
]); ?> | ||
</div> | ||
<div class="card-footer"> | ||
<?= $this->partial('partial/indexpager', ['aItems' => $aItems,'sRoute' => $sRoute]); ?> | ||
</div> | ||
</div> | ||
<?php if(isset($aResults)) { ?> | ||
<?php } else { ?> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2>Results</h2> | ||
</div> | ||
<div class="card-body"> | ||
<ul class="list-group"> | ||
<?php | ||
foreach($aResults as $oContact) { ?> | ||
<li class="list-group-item"> | ||
<a href="<?=$this->url('contact',['action'=>'view','id'=>$oContact->getID()])?>" title="<?=$this->translate('View Contact')?>"> | ||
<?=$oContact->getLabel();?> | ||
</a> | ||
</li> | ||
<?php | ||
} | ||
?> | ||
</ul> | ||
<h2>Find Contact</h2> | ||
</div> | ||
<?php if(isset($aResults)) { ?> | ||
|
||
<?php } else { ?> | ||
<form action="" method="post"> | ||
<div class="card-body"> | ||
<?= $this->partial('partial/basictabs', ['sFormName'=>$this->sFormName]); ?> | ||
<?= $this->partial('partial/searchtabcontents', ['sFormName'=>$this->sFormName]); ?> | ||
</div> | ||
<div class="card-footer"> | ||
<button class="btn btn-primary" type="submit"> | ||
Start Search | ||
</button> | ||
</div> | ||
</form> | ||
<?php } ?> | ||
</div> | ||
</div> | ||
<?php } ?> | ||
</div> | ||
<?php if(isset($aResults)) { ?> | ||
<div class="col-md-12"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
<h2>Results - <?=$aResults->getTotalItemCount()?></h2> | ||
</div> | ||
<div class="card-body"> | ||
<ul class="list-group"> | ||
<?php | ||
foreach($aResults as $oContact) { ?> | ||
<li class="list-group-item"> | ||
<a href="<?=$this->url('contact',['action'=>'view','id'=>$oContact->getID()])?>" title="<?=$this->translate('View Contact')?>"> | ||
<?=$oContact->getLabel();?> | ||
</a> | ||
</li> | ||
<?php | ||
} | ||
?> | ||
</ul> | ||
<?= $this->partial('partial/indexpager', ['aItems'=>$aResults,'sRoute'=>'contact-search']); ?> | ||
</div> | ||
</div> | ||
</div> | ||
<?php } ?> | ||
</div> | ||
<?php } ?> |