Diversen opmerkingen Peter (23-08-2019)
This commit is contained in:
@@ -9,363 +9,365 @@ defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
*/
|
||||
class ProjectsController extends MY_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
||||
|
||||
$models = ['projects/Invoices_model'];
|
||||
$libraries = [];
|
||||
$models = ['projects/Invoices_model'];
|
||||
$libraries = [];
|
||||
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllProjects()
|
||||
{
|
||||
$archive = $this->clean_input( 'archive' );
|
||||
$search = $this->clean_input( 'search' );
|
||||
$order = $this->clean_input( 'order' );
|
||||
$direction = $this->clean_input( 'direction' );
|
||||
public function getAllProjects()
|
||||
{
|
||||
$archive = $this->clean_input( 'archive' );
|
||||
$search = $this->clean_input( 'search' );
|
||||
$order = $this->clean_input( 'order' );
|
||||
$direction = $this->clean_input( 'direction' );
|
||||
|
||||
$projects = Project::getAllProjects( $archive, $search, $order, $direction );
|
||||
$projects = Project::getAllProjects( $archive, $search, $order, $direction );
|
||||
|
||||
$this->json( $projects );
|
||||
}
|
||||
$this->json( $projects );
|
||||
}
|
||||
|
||||
public function getProject( $projectID )
|
||||
{
|
||||
$project = Project::getProject( $projectID );
|
||||
public function getProject( $projectID )
|
||||
{
|
||||
$project = Project::getProject( $projectID );
|
||||
|
||||
$project->invoiceDetails =
|
||||
$this->Invoices_model->getOutstandingPerProject( $project->id );
|
||||
$project->invoiceDetails =
|
||||
$this->Invoices_model->getOutstandingPerProject( $project->id );
|
||||
|
||||
$project->hourTotals =
|
||||
Projecthour::getTotalHoursPerProject( $project->id );
|
||||
$project->hourTotals =
|
||||
Projecthour::getTotalHoursPerProject( $project->id );
|
||||
|
||||
$this->json( $project );
|
||||
}
|
||||
$this->json( $project );
|
||||
}
|
||||
|
||||
public function getAvailableEmployees( $projectID )
|
||||
{
|
||||
$availableEmployees =
|
||||
Projectemployee::getAvailableEmployees( $projectID );
|
||||
public function getAvailableEmployees( $projectID )
|
||||
{
|
||||
$availableEmployees =
|
||||
Projectemployee::getAvailableEmployees( $projectID );
|
||||
|
||||
$this->json( $availableEmployees );
|
||||
}
|
||||
$this->json( $availableEmployees );
|
||||
}
|
||||
|
||||
public function addProject()
|
||||
{
|
||||
$projectID = Project::createProject();
|
||||
public function addProject()
|
||||
{
|
||||
$projectID = Project::createProject();
|
||||
|
||||
$this->json( $projectID );
|
||||
}
|
||||
$this->json( $projectID );
|
||||
}
|
||||
|
||||
public function creatProjectFromOffer( $offerID )
|
||||
{
|
||||
$offer = Offer::find( $offerID );
|
||||
public function creatProjectFromOffer( $offerID )
|
||||
{
|
||||
$offer = Offer::find( $offerID );
|
||||
|
||||
$offernumber = $offer->offernumber;
|
||||
$offernumber = $offer->offernumber;
|
||||
|
||||
$projectnumber = 'P' . substr( $offernumber, 1 );
|
||||
$projectnumber = 'P' . substr( $offernumber, 1 );
|
||||
|
||||
$data = [
|
||||
'projectnumber' => $projectnumber,
|
||||
'projectname' => $offer->offername,
|
||||
'projectleader_id' => $offer->offerleader_id,
|
||||
'startdate' => $offer->accepteddate,
|
||||
'customer_id' => $offer->customer_id
|
||||
];
|
||||
$data = [
|
||||
'projectnumber' => $projectnumber,
|
||||
'projectname' => $offer->offername,
|
||||
'projectleader_id' => $offer->offerleader_id,
|
||||
'startdate' => $offer->accepteddate,
|
||||
'customer_id' => $offer->customer_id
|
||||
];
|
||||
|
||||
$project = Project::create( $data );
|
||||
$project = Project::create( $data );
|
||||
|
||||
Offer::whereId( $offerID )->update( ['project_id' => $project->id] );
|
||||
Offer::whereId( $offerID )->update( ['project_id' => $project->id] );
|
||||
|
||||
Projectemployee::firstOrCreateProjectemployee( $offer->offerleader_id, $project->id );
|
||||
Projectemployee::firstOrCreateProjectemployee( $offer->offerleader_id, $project->id );
|
||||
|
||||
$offerteHours = Employeehour::whereOfferId( $offerID )->get();
|
||||
foreach ( $offerteHours as $offerteHour )
|
||||
{
|
||||
$projectemployee =
|
||||
Projectemployee::firstOrCreateProjectemployee( $offerteHour->employee_id, $project->id );
|
||||
$offerteHours = Employeehour::whereOfferId( $offerID )->get();
|
||||
foreach ( $offerteHours as $offerteHour )
|
||||
{
|
||||
$projectemployee =
|
||||
Projectemployee::firstOrCreateProjectemployee( $offerteHour->employee_id, $project->id );
|
||||
|
||||
$data = [
|
||||
'projectemployee_id' => $projectemployee->id,
|
||||
'hourtype_id' => 10,
|
||||
'hourdate' => $offerteHour->hourdate,
|
||||
'hours' => $offerteHour->hours
|
||||
];
|
||||
$data = [
|
||||
'projectemployee_id' => $projectemployee->id,
|
||||
'hourtype_id' => 10,
|
||||
'hourdate' => $offerteHour->hourdate,
|
||||
'hours' => $offerteHour->hours
|
||||
];
|
||||
|
||||
Projecthour::create( $data );
|
||||
Projecthour::create( $data );
|
||||
|
||||
Employeehour::whereId( $offerteHour->id )->delete();
|
||||
}
|
||||
Employeehour::whereId( $offerteHour->id )->delete();
|
||||
}
|
||||
|
||||
$this->json( ['success' => TRUE, 'projectnumber' => $projectnumber] );
|
||||
}
|
||||
$this->json( ['success' => TRUE, 'projectnumber' => $projectnumber] );
|
||||
}
|
||||
|
||||
public function addProjectEmployee( $projectID )
|
||||
{
|
||||
Projectemployee::createProjectEmployee( $projectID );
|
||||
}
|
||||
public function addProjectEmployee( $projectID )
|
||||
{
|
||||
Projectemployee::createProjectEmployee( $projectID );
|
||||
}
|
||||
|
||||
public function saveProject()
|
||||
{
|
||||
$projectValidation = new ProjectValidation();
|
||||
public function saveProject()
|
||||
{
|
||||
$projectValidation = new ProjectValidation();
|
||||
|
||||
if ( ! $projectValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectValidation->getErrorMessages()] );
|
||||
if ( ! $projectValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectValidation->getErrorMessages()] );
|
||||
|
||||
$project = $this->input->post();
|
||||
$project = $this->input->post();
|
||||
|
||||
$projectID = $project['id'];
|
||||
unset( $project['id'] );
|
||||
$projectID = $project['id'];
|
||||
unset( $project['id'] );
|
||||
|
||||
$project['startdate'] = date2mysql( $project['startdate'] );
|
||||
$project['enddate'] = date2mysql( $project['enddate'] );
|
||||
$project['startdate'] = date2mysql( $project['startdate'] );
|
||||
$project['enddate'] = date2mysql( $project['enddate'] );
|
||||
|
||||
$projectID = Project::saveProject( $projectID, $project );
|
||||
$projectID = Project::saveProject( $projectID, $project );
|
||||
|
||||
$this->json( ['success' => TRUE, 'projectID' => $projectID] );
|
||||
}
|
||||
Offer::syncProjectname( $projectID );
|
||||
|
||||
public function saveProjectemployee()
|
||||
{
|
||||
$projectemployeeValidation = new ProjectemployeeValidation();
|
||||
$this->json( ['success' => TRUE, 'projectID' => $projectID] );
|
||||
}
|
||||
|
||||
if ( ! $projectemployeeValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectemployeeValidation->getErrorMessages()] );
|
||||
public function saveProjectemployee()
|
||||
{
|
||||
$projectemployeeValidation = new ProjectemployeeValidation();
|
||||
|
||||
$projectemployee = $this->input->post();
|
||||
if ( ! $projectemployeeValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectemployeeValidation->getErrorMessages()] );
|
||||
|
||||
$projectemployeeID = $projectemployee['id'];
|
||||
unset( $projectemployee['id'] );
|
||||
$projectemployee = $this->input->post();
|
||||
|
||||
Projectemployee::saveProjectemployee( $projectemployeeID, $projectemployee );
|
||||
$projectemployeeID = $projectemployee['id'];
|
||||
unset( $projectemployee['id'] );
|
||||
|
||||
$this->json( ['success' => TRUE] );
|
||||
}
|
||||
Projectemployee::saveProjectemployee( $projectemployeeID, $projectemployee );
|
||||
|
||||
public function saveInvoice()
|
||||
{
|
||||
$invoiceValidation = new InvoiceValidation();
|
||||
$this->json( ['success' => TRUE] );
|
||||
}
|
||||
|
||||
if ( ! $invoiceValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $invoiceValidation->getErrorMessages()] );
|
||||
public function saveInvoice()
|
||||
{
|
||||
$invoiceValidation = new InvoiceValidation();
|
||||
|
||||
$invoice = $this->input->post();
|
||||
if ( ! $invoiceValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $invoiceValidation->getErrorMessages()] );
|
||||
|
||||
$invoiceID = $invoice['id'];
|
||||
unset( $invoice['id'] );
|
||||
$invoice = $this->input->post();
|
||||
|
||||
$invoice['invoicedate'] = date2mysql( $invoice['invoicedate'] );
|
||||
$invoice['forecastdate'] = date2mysql( $invoice['forecastdate'] );
|
||||
$invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] );
|
||||
$invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] );
|
||||
$invoiceID = $invoice['id'];
|
||||
unset( $invoice['id'] );
|
||||
|
||||
$invoiceID = Invoice::saveInvoice( $invoiceID, $invoice );
|
||||
$invoice['invoicedate'] = date2mysql( $invoice['invoicedate'] );
|
||||
$invoice['forecastdate'] = date2mysql( $invoice['forecastdate'] );
|
||||
$invoice['invoiceamount'] = str_replace( ',', '.', $invoice['invoiceamount'] );
|
||||
$invoice['forecastamount'] = str_replace( ',', '.', $invoice['forecastamount'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'invoiceID' => $invoiceID] );
|
||||
}
|
||||
$invoiceID = Invoice::saveInvoice( $invoiceID, $invoice );
|
||||
|
||||
public function savePayment()
|
||||
{
|
||||
$paymentValidation = new PaymentValidation();
|
||||
$this->json( ['success' => TRUE, 'invoiceID' => $invoiceID] );
|
||||
}
|
||||
|
||||
if ( ! $paymentValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $paymentValidation->getErrorMessages()] );
|
||||
public function savePayment()
|
||||
{
|
||||
$paymentValidation = new PaymentValidation();
|
||||
|
||||
$payment = $this->input->post();
|
||||
if ( ! $paymentValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $paymentValidation->getErrorMessages()] );
|
||||
|
||||
$paymentID = $payment['id'];
|
||||
unset( $payment['id'] );
|
||||
$payment = $this->input->post();
|
||||
|
||||
$payment['paymentdate'] = date2mysql( $payment['paymentdate'] );
|
||||
$payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] );
|
||||
$paymentID = $payment['id'];
|
||||
unset( $payment['id'] );
|
||||
|
||||
$paymentID = Payment::savePayment( $paymentID, $payment );
|
||||
$payment['paymentdate'] = date2mysql( $payment['paymentdate'] );
|
||||
$payment['paymentamount'] = str_replace( ',', '.', $payment['paymentamount'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'paymentID' => $paymentID] );
|
||||
}
|
||||
$paymentID = Payment::savePayment( $paymentID, $payment );
|
||||
|
||||
public function saveProjectcost()
|
||||
{
|
||||
$projectcostValidation = new ProjectcostValidation();
|
||||
$this->json( ['success' => TRUE, 'paymentID' => $paymentID] );
|
||||
}
|
||||
|
||||
if ( ! $projectcostValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectcostValidation->getErrorMessages()] );
|
||||
public function saveProjectcost()
|
||||
{
|
||||
$projectcostValidation = new ProjectcostValidation();
|
||||
|
||||
$projectcost = $this->input->post();
|
||||
if ( ! $projectcostValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projectcostValidation->getErrorMessages()] );
|
||||
|
||||
$projectcostID = $projectcost['id'];
|
||||
unset( $projectcost['id'] );
|
||||
$projectcost = $this->input->post();
|
||||
|
||||
$projectcost['date'] = date2mysql( $projectcost['date'] );
|
||||
$projectcostID = $projectcost['id'];
|
||||
unset( $projectcost['id'] );
|
||||
|
||||
$projectcostID = Projectcost::saveProjectcost( $projectcostID, $projectcost );
|
||||
$projectcost['date'] = date2mysql( $projectcost['date'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'projectcostID' => $projectcostID] );
|
||||
}
|
||||
$projectcostID = Projectcost::saveProjectcost( $projectcostID, $projectcost );
|
||||
|
||||
public function saveProjecthour()
|
||||
{
|
||||
$projecthourValidation = new ProjecthourValidation();
|
||||
$this->json( ['success' => TRUE, 'projectcostID' => $projectcostID] );
|
||||
}
|
||||
|
||||
if ( ! $projecthourValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projecthourValidation->getErrorMessages()] );
|
||||
public function saveProjecthour()
|
||||
{
|
||||
$projecthourValidation = new ProjecthourValidation();
|
||||
|
||||
$projecthour = $this->input->post();
|
||||
if ( ! $projecthourValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $projecthourValidation->getErrorMessages()] );
|
||||
|
||||
$projecthourID = $projecthour['id'];
|
||||
unset( $projecthour['id'] );
|
||||
$projecthour = $this->input->post();
|
||||
|
||||
$projecthour['hourdate'] = date2mysql( $projecthour['hourdate'] );
|
||||
$projecthourID = $projecthour['id'];
|
||||
unset( $projecthour['id'] );
|
||||
|
||||
$paymentID = Projecthour::saveProjecthour( $projecthourID, $projecthour );
|
||||
$projecthour['hourdate'] = date2mysql( $projecthour['hourdate'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'projecthourID' => $paymentID] );
|
||||
}
|
||||
$paymentID = Projecthour::saveProjecthour( $projecthourID, $projecthour );
|
||||
|
||||
public function saveForecast()
|
||||
{
|
||||
$forecastValidation = new ForecastValidation();
|
||||
$this->json( ['success' => TRUE, 'projecthourID' => $paymentID] );
|
||||
}
|
||||
|
||||
if ( ! $forecastValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $forecastValidation->getErrorMessages()] );
|
||||
public function saveForecast()
|
||||
{
|
||||
$forecastValidation = new ForecastValidation();
|
||||
|
||||
$forecast = $this->input->post();
|
||||
if ( ! $forecastValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $forecastValidation->getErrorMessages()] );
|
||||
|
||||
$forecastID = $forecast['id'];
|
||||
unset( $forecast['id'] );
|
||||
$forecast = $this->input->post();
|
||||
|
||||
$forecastID = Forecast::saveForecast( $forecastID, $forecast );
|
||||
$forecastID = $forecast['id'];
|
||||
unset( $forecast['id'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'forecastID' => $forecastID] );
|
||||
}
|
||||
$forecastID = Forecast::saveForecast( $forecastID, $forecast );
|
||||
|
||||
public function saveReservation()
|
||||
{
|
||||
$reservationValidation = new ReservationValidation();
|
||||
$this->json( ['success' => TRUE, 'forecastID' => $forecastID] );
|
||||
}
|
||||
|
||||
if ( ! $reservationValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $reservationValidation->getErrorMessages()] );
|
||||
public function saveReservation()
|
||||
{
|
||||
$reservationValidation = new ReservationValidation();
|
||||
|
||||
$reservation = $this->input->post();
|
||||
if ( ! $reservationValidation->getValidationResult() )
|
||||
return $this->json( [
|
||||
'success' => FALSE, 'messages' => $reservationValidation->getErrorMessages()] );
|
||||
|
||||
$reservationID = $reservation['id'];
|
||||
unset( $reservation['id'] );
|
||||
$reservation = $this->input->post();
|
||||
|
||||
$reservationID = Reservation::saveReservation( $reservationID, $reservation );
|
||||
$reservationID = $reservation['id'];
|
||||
unset( $reservation['id'] );
|
||||
|
||||
$this->json( ['success' => TRUE, 'reservationID' => $reservationID] );
|
||||
}
|
||||
$reservationID = Reservation::saveReservation( $reservationID, $reservation );
|
||||
|
||||
public function archiveProject( $projectID, $status )
|
||||
{
|
||||
Project::whereId( $projectID )->update( ['archive' => $status] );
|
||||
}
|
||||
$this->json( ['success' => TRUE, 'reservationID' => $reservationID] );
|
||||
}
|
||||
|
||||
public function removeProjectemployee( $projectemployeeID )
|
||||
{
|
||||
$removeProjectemployee = new RemoveProjectemployee( $projectemployeeID );
|
||||
public function archiveProject( $projectID, $status )
|
||||
{
|
||||
Project::whereId( $projectID )->update( ['archive' => $status] );
|
||||
}
|
||||
|
||||
if ( $removeProjectemployee->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
public function removeProjectemployee( $projectemployeeID )
|
||||
{
|
||||
$removeProjectemployee = new RemoveProjectemployee( $projectemployeeID );
|
||||
|
||||
Projectemployee::removeProjectemployee( $projectemployeeID );
|
||||
if ( $removeProjectemployee->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
Projectemployee::removeProjectemployee( $projectemployeeID );
|
||||
|
||||
public function removeInvoice( $invoiceID )
|
||||
{
|
||||
$removeInvoice = new RemoveInvoice( $invoiceID );
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
if ( $removeInvoice->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
public function removeInvoice( $invoiceID )
|
||||
{
|
||||
$removeInvoice = new RemoveInvoice( $invoiceID );
|
||||
|
||||
Invoice::whereId( $invoiceID )->delete();
|
||||
if ( $removeInvoice->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
Invoice::whereId( $invoiceID )->delete();
|
||||
|
||||
public function removeIncomingInvoice( $invoiceID )
|
||||
{
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeIncomingInvoice( $invoiceID )
|
||||
{
|
||||
// $removeInvoice = new RemoveInvoice( $invoiceID );
|
||||
//
|
||||
// if ( $removeInvoice->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Projectcost::whereId( $invoiceID )->delete();
|
||||
Projectcost::whereId( $invoiceID )->delete();
|
||||
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
return $this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removePayment( $paymentID )
|
||||
{
|
||||
$removePayment = new RemovePayment( $paymentID );
|
||||
public function removePayment( $paymentID )
|
||||
{
|
||||
$removePayment = new RemovePayment( $paymentID );
|
||||
|
||||
if ( $removePayment->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removePayment->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Payment::removePayment( $paymentID );
|
||||
Payment::removePayment( $paymentID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeProjecthour( $projecthourID )
|
||||
{
|
||||
$removeProjecthour = new RemoveProjecthour( $projecthourID );
|
||||
public function removeProjecthour( $projecthourID )
|
||||
{
|
||||
$removeProjecthour = new RemoveProjecthour( $projecthourID );
|
||||
|
||||
if ( $removeProjecthour->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removeProjecthour->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Projecthour::removeProjecthour( $projecthourID );
|
||||
Projecthour::removeProjecthour( $projecthourID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeForecast( $forecastID )
|
||||
{
|
||||
$removeForecast = new RemoveForecast( $forecastID );
|
||||
public function removeForecast( $forecastID )
|
||||
{
|
||||
$removeForecast = new RemoveForecast( $forecastID );
|
||||
|
||||
if ( $removeForecast->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removeForecast->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Forecast::removeForecast( $forecastID );
|
||||
Forecast::removeForecast( $forecastID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeReservation( $reservationID )
|
||||
{
|
||||
$removeReservation = new RemoveReservation( $reservationID );
|
||||
public function removeReservation( $reservationID )
|
||||
{
|
||||
$removeReservation = new RemoveReservation( $reservationID );
|
||||
|
||||
if ( $removeReservation->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removeReservation->getAllowDelete() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Reservation::removeReservation( $reservationID );
|
||||
Reservation::removeReservation( $reservationID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
public function removeProject( $projectID )
|
||||
{
|
||||
$removeProject = new RemoveProject( $projectID );
|
||||
public function removeProject( $projectID )
|
||||
{
|
||||
$removeProject = new RemoveProject( $projectID );
|
||||
|
||||
if ( $removeProject->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
if ( $removeProject->getRemoveAllowed() === FALSE ) return $this->json( ['result' => FALSE] );
|
||||
|
||||
Project::removeProject( $projectID );
|
||||
Project::removeProject( $projectID );
|
||||
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
$this->json( ['result' => TRUE] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user