Skip to content

Commit

Permalink
馃崗 Lost file compannyapps restored
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Apr 12, 2024
1 parent 0df6479 commit 2897121
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/companyapp.php
Expand Up @@ -9,9 +9,6 @@

namespace MultiFlexi\Ui;

use Ease\Html\ATag;
use Ease\TWB4\Panel;
use Ease\TWB4\Row;
use MultiFlexi\Company;

require_once './init.php';
Expand Down
66 changes: 66 additions & 0 deletions src/companyapps.php
@@ -0,0 +1,66 @@
<?php

/**
* Multi Flexi - AdHoc Job launcher
*
* @author V铆t臎zslav Dvo艡谩k <info@vitexsoftware.cz>
* @copyright 2020-2024 Vitex Software
*/

namespace MultiFlexi\Ui;

use MultiFlexi\Ui\PageBottom;
use MultiFlexi\Ui\PageTop;

require_once './init.php';

$oPage->onlyForLogged();

$appsAssigned = \Ease\WebPage::getRequestValue('appsassigned');
// 3,4,6,5


$companer = new \MultiFlexi\Company(\Ease\WebPage::getRequestValue('company_id', 'int'));

if (is_null($companer->getMyKey())) {
$oPage->redirect('companys.php');
}

$companyApp = new \MultiFlexi\CompanyApp($companer);
if (\Ease\WebPage::isPosted()) {
$companyApp->assignApps(strchr($appsAssigned, ',') === false ? [intval($appsAssigned)] : array_map('intval', explode(',', $appsAssigned)));
}


$oPage->addItem(new PageTop(_('Applications used by Company')));

$addAppForm = new \Ease\TWB4\Form();
$addAppForm->addItem(new \Ease\Html\InputHiddenTag('company_id', $companer->getMyKey()));

$assignedRaw = $companyApp->getAssigned()->fetchAll('app_id');
$assigned = empty($assignedRaw) ? [] : array_keys($assignedRaw);
$chooseApp = new AppsSelector('appsassigned', implode(',', $assigned));



$addAppForm->addItem(new \Ease\Html\H2Tag(sprintf(_('Choose Applications to use with %s company'), $companer->getRecordName())));

$addAppForm->addItem($chooseApp);

$addAppForm->addItem(new \Ease\TWB4\SubmitButton('馃崗 ' . _('Apply'), 'success btn-lg btn-block'));

$oPage->container->addItem(new CompanyPanel($companer, $addAppForm));

//$apper = new \MultiFlexi\Application();
//
//$launchTabs = new \Ease\TWB4\Tabs();
//foreach ($assigned as $assignedAppId) {
// $apper->loadFromSQL($assignedAppId);
// $launchTabs->addTab($apper->getRecordName(), new AppInfo($apper, $companer->getMyKey()));
//}
//$oPage->container->addItem($launchTabs);


$oPage->addItem(new PageBottom());

$oPage->draw();
2 changes: 1 addition & 1 deletion src/intervals.php
Expand Up @@ -46,7 +46,7 @@
$addAppForm->addItem($periodSelectorsRow);
$addAppForm->addItem(new \Ease\Html\PTag());

$addAppForm->addItem(new \Ease\TWB4\SubmitButton(_('Apply'), 'success btn-lg btn-block'));
$addAppForm->addItem(new \Ease\TWB4\SubmitButton('馃崗 '._('Apply'), 'success btn-lg btn-block'));

$oPage->container->addItem($addAppForm);

Expand Down

0 comments on commit 2897121

Please sign in to comment.