public static function createAppointmentLinkUsingDeal($instructionId, $appStartDate, $appType = Appointment::TYPE_VIEWING)
 {
     if (!$instructionId || !$appStartDate) {
         return false;
     }
     $appointmentsByDeal = LinkDealToAppointment::model()->findAllByAttributes(['d2a_dea' => $instructionId]);
     $appIdsByDeal = [];
     foreach ($appointmentsByDeal as $value) {
         /** @var $value LinkDealToAppointment[ ] */
         if ($value->appointment->app_start == $appStartDate && $value->appointment->app_type == $appType) {
             $appIdsByDeal[] = $value->appointment->app_id;
         }
     }
     return AppointmentController::createAppointmentUpdateLink(reset($appIdsByDeal));
 }
Ejemplo n.º 2
0
?>
">
		<?php 
echo $sms->text;
?>
		<div class="beak"></div>
	</div>
	<?php 
if ($sms->type === Sms::TYPE_OUTGOING && isset($sms->appointment[0])) {
    ?>
		<?php 
    $app = $sms->appointment[0];
    ?>
		<div class="app-info">
			<div><?php 
    echo CHtml::link($app->app_type == Appointment::TYPE_VIEWING ? "Viewing" : "Valuation", AppointmentController::createAppointmentUpdateLink($app->app_id));
    ?>
</div>
			<?php 
    foreach ($app->instructions as $key => $instruction) {
        ?>
				<div><?php 
        echo $instruction->address->toString();
        ?>
</div>
			<?php 
    }
    ?>
		</div>
	<?php 
}
Ejemplo n.º 3
0
                    case LinkDealToAppointment::FEEDBACK_NEGATIVE:
                        $negativeFeedback++;
                        break;
                    default:
                        $noFeedback++;
                }
            }
            echo '<div style="padding: 4px 0">';
            echo CHtml::link($feedback ? $feedback : "(not entered)", $this->createUrl('appointment/feedback', ['id' => $id]));
            echo '</div>';
        }
    }
    ?>
				</td>
				<td><?php 
    echo CHtml::link(CHtml::image(Icon::EDIT_ICON), AppointmentController::createAppointmentUpdateLink($viewing->app_id));
    ?>
</td>
			</tr>
		<?php 
}
?>
		<tr>
			<td colspan="5">
				(
				Total Properties Viewed:<b><?php 
echo $totalViewed;
?>
</b>&nbsp;
				Positive:<b><?php 
echo $positiveFeedback;
Ejemplo n.º 4
0
		<label class="control-label">Note type</label>

		<div class="controls">
			<?php 
echo $form->checkBoxListWithSelectOnLabel($model, 'app_notetype', Appointment::getNoteTypes(), ['separator' => ' ']);
?>
		</div>
		<?php 
echo $form->endControlGroup();
?>
	</div>
</fieldset>
<?php 
$this->endWidget();
$this->widget('AdminGridView', array('dataProvider' => $dataProvider, 'title' => 'SEARCH APPOINTMENT', 'id' => 'appointment-list', 'columns' => array(array('class' => 'CButtonColumn', 'header' => 'Actions', 'template' => '{edit}', 'buttons' => array('edit' => array('label' => 'Edit', 'url' => function (Appointment $data) {
    return AppointmentController::createEditLink($data->app_id);
}, 'imageUrl' => Icon::EDIT_ICON))), array('name' => 'app_status', 'htmlOptions' => ['style' => 'width: 80px;']), 'app_start' => array('name' => 'app_start', 'header' => 'start', 'htmlOptions' => ['style' => 'width: 130px;'], 'value' => function (Appointment $data) {
    return Date::formatDate('d/m/Y H:i', $data->app_start);
}), 'app_type', 'app_notetype', 'app_subject', array('name' => 'user.fullName', 'header' => 'User', 'value' => function ($data) {
    return $data->user ? $data->user->fullName : 'unassigned';
}), array('name' => 'client', 'header' => 'Clients', 'type' => 'raw', 'value' => function (Appointment $data) {
    $t = [];
    foreach ($data->clients as $key => $client) {
        $t[] = CHtml::link($client->getFullName(), Yii::app()->createUrl('admin4/client/update', ['id' => $client->cli_id]));
    }
    return implode(', ', $t);
}), array('header' => 'Address', 'name' => 'address', 'type' => 'raw', 'value' => function (Appointment $data) {
    $str = [];
    foreach ($data->addresses as $key => $value) {
        $str[] = $value->getFullAddressString(', ');
    }