public function run()
 {
     DB::table('applications')->delete();
     User::create(['date', 'position', 'description', 'company', 'contact_name', 'contact_title', 'phone', 'fax', 'email', 'address', 'website', 'application_method', 'heard_about', 'status', 'references']);
     Application::create(array('date' => '04/15/15', 'position' => 'Sales Associate', 'description' => 'Inform customers about our new products and services', 'company' => 'ABC Decor', 'address' => '3572 N. Professional Avenue', 'contact_name' => 'John Femont', 'contact_title' => 'Regional Supervisor', 'phone' => '509-442-7564', 'fax' => '509-442-7565', 'email' => '*****@*****.**', 'website' => 'http://www.abcdecor.com', 'application_method' => 'Faxed Resume', 'heard_about' => 'Colleague', 'status' => 'Pending Interview', 'references' => 'Tommy Regal'));
     Application::create(array('date' => '04/15/15', 'position' => 'Community Event Organizer', 'description' => 'Assist ACB with scheduling and organization local community events', 'company' => 'ACB Event Specialists', 'address' => '6372 N. Epic St', 'contact_name' => 'Crystal Denoma', 'contact_title' => 'ACB Manager', 'phone' => '509-947-5743', 'fax' => '509-947-6382', 'email' => '*****@*****.**', 'website' => 'http://www.acbevents.org', 'application_method' => 'Indeed.com', 'heard_about' => 'Job Board', 'status' => 'Interviewed', 'references' => 'None'));
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 500) as $index) {
         Application::create(['name' => $faker->word, 'url' => $faker->url]);
     }
 }
Example #3
0
    public function startCase($sTasUid, $sUsrUid, $isSubprocess = false, $dataPreviusApplication = array())

    {

        if ($sTasUid != '') {

            try {

                $task = TaskPeer::retrieveByPK($sTasUid);



                if (is_null($task)) {

                    throw new Exception(G::LoadTranslation("ID_TASK_NOT_EXIST", array("TAS_UID", $sTasUid)));

                }



                //To allow Self Service as the first task

                $arrayTaskTypeToExclude = array("START-TIMER-EVENT");



                if (!is_null($task) && !in_array($task->getTasType(), $arrayTaskTypeToExclude) && $task->getTasAssignType() != "SELF_SERVICE" && $sUsrUid == "") {

                    throw (new Exception('You tried to start a new case without send the USER UID!'));

                }



                //Process

                $sProUid = $task->getProUid();

                $this->Process = new Process;

                $proFields = $this->Process->Load($sProUid);



                //application

                $Application = new Application;

                $sAppUid = $Application->create($sProUid, $sUsrUid);



                //appDelegation

                $AppDelegation = new AppDelegation;

                $iAppThreadIndex = 1; // Start Thread

                $iAppDelPrio = 3; // Priority

                $iDelIndex = $AppDelegation->createAppDelegation(

                        $sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iAppDelPrio, $isSubprocess

                );



                //appThread

                $AppThread = new AppThread;

                $iAppThreadIndex = $AppThread->createAppThread($sAppUid, $iDelIndex, 0);



                //DONE: Al ya existir un delegation, se puede "calcular" el caseTitle.

                $Fields = $Application->toArray(BasePeer::TYPE_FIELDNAME);

                $aApplicationFields = $Fields['APP_DATA'];

                $newValues = $this->newRefreshCaseTitleAndDescription($sAppUid, $Fields, $aApplicationFields);

                if (!isset($newValues['APP_TITLE'])) {

                    $newValues['APP_TITLE'] = '';

                }



                $caseNumber = $Fields['APP_NUMBER'];

                $Application->update($Fields);



                //Update the task last assigned (for web entry and web services)

                G::LoadClass('derivation');

                $oDerivation = new Derivation();

                $oDerivation->setTasLastAssigned($sTasUid, $sUsrUid);



                // Execute Events

                require_once 'classes/model/Event.php';

                $event = new Event();

                $event->createAppEvents($sProUid, $sAppUid, $iDelIndex, $sTasUid);



                //update searchindex

                if ($this->appSolr != null) {

                    $this->appSolr->updateApplicationSearchIndex($sAppUid);

                }



                /*----------------------------------********---------------------------------*/

            } catch (exception $e) {

                throw ($e);

            }

        } else {

            throw (new Exception('You tried to start a new case without send the USER UID or TASK UID!'));

        }



        //call plugin

        if (class_exists('folderData')) {

            $folderData = new folderData(

                            $sProUid,

                            $proFields['PRO_TITLE'],

                            $sAppUid,

                            $newValues['APP_TITLE'],

                            $sUsrUid

            );

            $oPluginRegistry = &PMPluginRegistry::getSingleton();

            $oPluginRegistry->executeTriggers(PM_CREATE_CASE, $folderData);

        }

        //end plugin

        return array(

            'APPLICATION' => $sAppUid,

            'INDEX' => $iDelIndex,

            'PROCESS' => $sProUid,

            'CASE_NUMBER' => $caseNumber

        );

    }
Example #4
0
 public function setUp()
 {
     $autoloader = (require __DIR__ . '/../../vendor/autoload.php');
     $this->appPkg = Application::create($autoloader)->addExtension(__DIR__ . '/../..')->bootstrap(Event\Type\Dummy::create());
 }
Example #5
0
 public function startCase($sTasUid, $sUsrUid, $isSubprocess = false)
 {
     if ($sTasUid != '') {
         try {
             $this->Task = new Task();
             $Fields = $this->Task->Load($sTasUid);
             //To allow Self Service as the first task
             if ($Fields['TAS_ASSIGN_TYPE'] != 'SELF_SERVICE' && $sUsrUid == '') {
                 throw new Exception('You tried to start a new case without send the USER UID!');
             }
             //Process
             $sProUid = $this->Task->getProUid();
             $this->Process = new Process();
             $proFields = $this->Process->Load($sProUid);
             //application
             $Application = new Application();
             $sAppUid = $Application->create($sProUid, $sUsrUid);
             //appDelegation
             $AppDelegation = new AppDelegation();
             $iAppThreadIndex = 1;
             // Start Thread
             $iAppDelPrio = 3;
             // Priority
             $iDelIndex = $AppDelegation->createAppDelegation($sProUid, $sAppUid, $sTasUid, $sUsrUid, $iAppThreadIndex, $iAppDelPrio, $isSubprocess);
             //appThread
             $AppThread = new AppThread();
             $iAppThreadIndex = $AppThread->createAppThread($sAppUid, $iDelIndex, 0);
             //DONE: Al ya existir un delegation, se puede "calcular" el caseTitle.
             $Fields = $Application->toArray(BasePeer::TYPE_FIELDNAME);
             $aApplicationFields = $Fields['APP_DATA'];
             $newValues = $this->newRefreshCaseTitleAndDescription($sAppUid, $Fields, $aApplicationFields);
             if (!isset($newValues['APP_TITLE'])) {
                 $newValues['APP_TITLE'] = '';
             }
             $caseNumber = $Fields['APP_NUMBER'];
             $Application->update($Fields);
             //Update the task last assigned (for web entry and web services)
             G::LoadClass('derivation');
             $oDerivation = new Derivation();
             $oDerivation->setTasLastAssigned($sTasUid, $sUsrUid);
             //update searchindex
             if ($this->appSolr != null) {
                 $this->appSolr->updateApplicationSearchIndex($sAppUid);
             }
         } catch (exception $e) {
             throw $e;
         }
     } else {
         throw new Exception('You tried to start a new case without send the USER UID or TASK UID!');
     }
     //call plugin
     if (class_exists('folderData')) {
         $folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $newValues['APP_TITLE'], $sUsrUid);
         $oPluginRegistry =& PMPluginRegistry::getSingleton();
         $oPluginRegistry->executeTriggers(PM_CREATE_CASE, $folderData);
     }
     //end plugin
     return array('APPLICATION' => $sAppUid, 'INDEX' => $iDelIndex, 'PROCESS' => $sProUid, 'CASE_NUMBER' => $caseNumber);
 }
Example #6
0
 /**
  * Create new Application
  * @param  string $key
  * @param  string $secret
  * @return Application
  */
 public function create($name, $key, $secret)
 {
     return $this->application->create(["name" => $name, "key" => $key, "secret" => $secret]);
 }
    $t->is($e->getMessage(), "Error in setAppTitle, the APP_UID can't be blank", 'setAppTitle() return Error in getAppTitle, the APP_UID cant be blank');
}
//create
try {
    $obj = new Application();
    $res = $obj->create();
} catch (Exception $e) {
    //#14
    $t->isa_ok($e, 'PropelException', 'create() return error when APP_UID is not defined');
    //#15
    $t->like($e->getMessage(), "%Unable to execute INSERT statement%", 'getAppTitle() return Error in getAppTitle, the APP_UID cant be blank');
}
//create
try {
    $obj = new Application();
    $appUid = $obj->create('1');
    //#16
    $t->isa_ok($appUid, 'string', 'create(), creates a new application');
    //#17
    $t->is(strlen($appUid), 14, 'create(), creates a new application, Guid lenth=14 chars');
    $res = $obj->load($appUid);
    //#18
    $t->isa_ok($res, 'array', 'load(), loads a new application');
    //#19
    $t->is($res['APP_UID'], $appUid, 'load(), loads a new application, valid APP_UID');
    //#20
    $t->is($res['APP_FINISH_DATE'], '1902-01-01 00:00:00', 'load(), loads a new application, valid FINISH_DATE');
    //#21
    $t->like($res['APP_TITLE'], '%#%', 'load(), loads a new application, valid APP_TITLE');
    //#22
    $t->is($res['APP_PARENT'], '', 'load(), loads a new application, valid APP_PARENT');
Example #8
0
<?php

// putenv('DEBUG=1');
define('APP_PATH', __DIR__);
require APP_PATH . '/../../vendor/autoload.php';
require APP_PATH . '/lib/cover/Module.php';
require APP_PATH . '/lib/blog/Module.php';
require APP_PATH . '/lib/about/Module.php';
class Application extends Server\Application
{
    public function __construct(Server\LayerInterface $next = null, array $config = array(), array $env = array())
    {
        parent::__construct($next, $config, $env);
        $this->employ(['class' => 'Server\\Middleware\\Renderer'])->employ(['class' => 'About\\Module', 'pattern' => '/about*uri'])->employ(['class' => 'Blog\\Module', 'pattern' => '/blog*uri'])->employ(['class' => 'Cover\\Module']);
    }
    public function getMenuHtml()
    {
        return '<div class="xs-max-size"><div class="nav trinity rule-after">' . '<div class="nav-left">' . '<a class="button" href="' . $this->master->getRealPath('/') . '">' . $this->config['title'] . '</a>' . '<a class="button" href="' . $this->master->getRealPath('/blog') . '">Blog</a>' . '<a class="button" href="' . $this->master->getRealPath('/about') . '">About</a>' . '</div></div></div>';
    }
    public function getHeader($pageTitle = null)
    {
        return '<html><head><meta charset="utf-8"><title>' . (($pageTitle ? $pageTitle . ' – ' : '') . $this->config['title']) . '</title><link rel="stylesheet" href="http://localhost/~mariuslundgard/body/dist/body.css"></head><body class="no-margin">';
    }
    public function getFooter()
    {
        return '</head></html>';
    }
}
Application::create(null, ['title' => 'A Personal Site', 'basePath' => '/~mariuslundgard/php-server/example/personal'], $_SERVER)->call()->send();
Example #9
0
 function new_app()
 {
     if ($this->session_handler->is_logged_in()) {
         $application = new Application();
         $application->app_name = $this->input->post('apptitle', TRUE);
         $application->version = "";
         $application->description = $this->input->post('description', TRUE);
         $application->package_name = "";
         $application->cat_id = $this->input->post('category', TRUE);
         $application->price = trim($this->input->post('amount')) == "" ? 0 : $this->input->post('amount', TRUE);
         $application->upd_time = time();
         $application->website = $this->input->post('website', TRUE);
         $application->apk_path = "";
         $application->icon_path = "";
         $application->status = $this->input->post('status') == "publish" ? 1 : 0;
         $application->dev_id = $this->input->post('dev_id');
         if ($application->create()) {
             $data['title'] = "Add | " . $application->app_name . " | LoveWorld App Store";
             $this->session_handler->setFlashMessage("Your new application has been saved");
             $data['application'] = $application;
             $data['this_user'] = $this->developer->find_by_id($this->session_handler->user_id);
             $this->load->view('upload_app', $data);
         } else {
             $this->session_handler->setFlashMessage("Could not save your application.");
             header('Location: add');
         }
     } else {
         $msg = "You must log in first.";
         $this->session_handler->setFlashMessage($msg);
         header('Location: login');
         exit;
     }
     #-------------------------------------------------
     #	Parse apk to extract package name and version
     #	echo "Parsing apk file...<br />";
     #-------------------------------------------------
 }