public function setByData($data)
 {
     foreach ($data as $portfolioData) {
         $portfolio = new Portfolio();
         $portfolio->setByData($portfolioData);
         $this->_portfolios[] = $portfolio;
     }
 }
Пример #2
0
 static function addPortfolio($fields)
 {
     extract($fields);
     $portfolio = new Portfolio();
     $portfolio->name = $name;
     $portfolio->owner = $owner;
     $portfolio->created = common_sql_now();
     $portfolio->modified = common_sql_now();
     $result = $portfolio->insert();
     if (!$result) {
         common_log_db_error($portfolio, 'INSERT', __FILE__);
         return false;
     }
     return $portfolio;
 }
Пример #3
0
 /**
  * Can use TLH
  *
  * @return bool
  */
 public function canUseTlh()
 {
     if ($this->taxBracket >= $this->ria->getClientTaxBracket() && $this->portfolio->getTotalValue() >= $this->ria->getMinRelationshipValue()) {
         return true;
     }
     return false;
 }
 /**
  * @param string $authCode7
  * @param string $username
  * @param string $password
  * @param string $passwordCurrent
  */
 public function modify($authCode7, $username, $password, $passwordCurrent)
 {
     $result = [];
     $result['code'] = 0;
     $result['msg'] = '';
     $user = $this->verifyAuthCode7($authCode7);
     if ($user === false) {
         $result['code'] = 1;
         $result['msg'] = 'Invalid authCode7';
         return $result;
     }
     $resultSet = $this->portfolio->getDatabase()->prepare('SELECT 1 FROM users WHERE id = :id AND password = :password')->setParameter('id', $user)->setParameter('password', $this->encryptPass($passwordCurrent))->executeQuery();
     if (!$resultSet->next()) {
         $result['code'] = 2;
         $result['msg'] = 'Uw huidige wachtwoord komt niet overeen.';
         return $result;
     }
     if (!empty($username) && strlen($username) >= 3) {
         $this->portfolio->getDatabase()->prepare('UPDATE users SET username = :username WHERE id = :id')->setParameter('username', $username)->setParameter('id', $user)->execute();
     }
     if (!empty($password) && strlen($password) >= 3) {
         $this->portfolio->getDatabase()->prepare('UPDATE users SET password = :password WHERE id = :id')->setParameter('password', $this->encryptPass($password))->setParameter('id', $user)->execute();
     }
     $result['code'] = 3;
     $result['msg'] = 'Uw gegevens zijn gewijzigd.';
     if (empty($username) && empty($password) && strlen($username) < 3 && strlen($password) < 3) {
         $result['code'] = 4;
         $result['msg'] = 'Er is niks gewijzigd.';
     }
     return $result;
 }
Пример #5
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $actionBar = new \Widgets\ActionBar();
     $this->getExtension()->addJS();
     $actionBar->setActions(array(array("name" => \Portfolio::getInstance()->getText("newArtefacts"), "ajax" => array("onclick" => array("command" => "newArtefactForm", "namespace" => "portfolio", "params" => "", "requestType" => "popup")))));
     //		array("name" => "Bild anfügen<img src=\"{$editIcon}\">", "command" => "EditMessageImage", "namespace" => "forum", "params" => "{'messageObjectId':'{$this->id}','forum':'{$forumId}'}", "type" => "popup");
     $breadcrumb = new \Widgets\Breadcrumb();
     $breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Manage Artefacts"))));
     $tabBar = new \Widgets\TabBar();
     $tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Competences"), "link" => $this->getExtension()->getExtensionUrl() . "ViewChart/"), array("name" => \Portfolio::getInstance()->getText("Artefacts"), "link" => $this->getExtension()->getExtensionUrl() . "ManageArtefacts/")));
     $tabBar->setActiveTab(2);
     $clearer = new \Widgets\Clearer();
     $loader = new \Widgets\Loader();
     $loader->setWrapperId("artefactsWrapper");
     $loader->setMessage("loading artefacts ...");
     $loader->setCommand("loadArtefacts");
     $loader->setParams($this->params);
     $loader->setElementId("artefactsWrapper");
     $loader->setType("updater");
     $frameResponseObject->setTitle("Manage Artefacts");
     $frameResponseObject->addWidget($actionBar);
     $frameResponseObject->addWidget($breadcrumb);
     $frameResponseObject->addWidget($tabBar);
     $frameResponseObject->addWidget($clearer);
     $frameResponseObject->addWidget($loader);
     //$frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Пример #6
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $actionBar = new \Widgets\ActionBar();
     $actionBar->setActions(array(array("name" => \Portfolio::getInstance()->getText("new"), "ajax" => array("onclick" => array("command" => "newArtefact", "params" => array(), "requestType" => "popup")))));
     $breadcrumb = new \Widgets\Breadcrumb();
     $breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Manage Portfolios"))));
     $tabBar = new \Widgets\TabBar();
     $tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Portfolio"), "link" => $this->getExtension()->getExtensionUrl() . "MyPortfolio/"), array("name" => \Portfolio::getInstance()->getText("Shared Portfolios"), "link" => $this->getExtension()->getExtensionUrl() . "SharedProfiles/")));
     $tabBar->setActiveTab(1);
     $clearer = new \Widgets\Clearer();
     $loader = new \Widgets\Loader();
     $loader->setWrapperId("portfoliosWrapper");
     $loader->setMessage("loading portfolios ...");
     $loader->setCommand("loadPortfolios");
     $loader->setParams(array());
     $loader->setElementId("portfoliosWrapper");
     $loader->setType("updater");
     $frameResponseObject->setTitle("Manage Portfolios");
     $frameResponseObject->addWidget($actionBar);
     $frameResponseObject->addWidget($breadcrumb);
     $frameResponseObject->addWidget($tabBar);
     $frameResponseObject->addWidget($clearer);
     $frameResponseObject->addWidget($loader);
     //$frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Пример #7
0
 public function frameResponse(\FrameResponseObject $frameResponseObject)
 {
     $portfolio = \PortfolioModel::getById($this->portfolioId);
     $actionBar = new \Widgets\ActionBar();
     $actionBar->setActions(array(array("link" => "javascript:history.back()", "name" => "zurück"), array("name" => \Portfolio::getInstance()->getText("new"), "ajax" => array("onclick" => array("command" => "newArtefact", "params" => array(), "requestType" => "popup")))));
     $breadcrumb = new \Widgets\Breadcrumb();
     $breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Belege des Portfolios »" . $portfolio->getName() . "«"))));
     $tabBar = new \Widgets\TabBar();
     $tabBar->setTabs(array(array("name" => \Portfolio::getInstance()->getText("Dashboard"), "link" => $this->getextension()->getExtensionUrl() . "/"), array("name" => \Portfolio::getInstance()->getText("Portfolio"), "link" => $this->getExtension()->getExtensionUrl() . "MyPortfolio/"), array("name" => \Portfolio::getInstance()->getText("Shared Portfolios"), "link" => $this->getExtension()->getExtensionUrl() . "SharedProfiles/")));
     $tabBar->setActiveTab(1);
     $clearer = new \Widgets\Clearer();
     $loader = new \Widgets\Loader();
     $loader->setWrapperId("artefactsWrapper");
     $loader->setMessage("loading artefacts ...");
     $loader->setCommand("loadArtefacts");
     $loader->setParams(array(0 => $this->portfolioId));
     $loader->setElementId("artefactsWrapper");
     $loader->setType("updater");
     $frameResponseObject->setTitle("Belege verwalten");
     $frameResponseObject->addWidget($actionBar);
     $frameResponseObject->addWidget($breadcrumb);
     $frameResponseObject->addWidget($tabBar);
     $frameResponseObject->addWidget($clearer);
     $frameResponseObject->addWidget($loader);
     //$frameResponseObject->addWidget($rawHtml);
     return $frameResponseObject;
 }
Пример #8
0
 /**
  * testDeleteHabtmReferenceWithConditions method
  *
  * @return void
  */
 public function testDeleteHabtmReferenceWithConditions()
 {
     $this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio', 'Syfile', 'Image');
     $Portfolio = new Portfolio();
     $Portfolio->hasAndBelongsToMany['Item']['conditions'] = array('ItemsPortfolio.item_id >' => 1);
     $result = $Portfolio->find('first', array('conditions' => array('Portfolio.id' => 1)));
     $expected = array(array('id' => 3, 'syfile_id' => 3, 'published' => false, 'name' => 'Item 3', 'ItemsPortfolio' => array('id' => 3, 'item_id' => 3, 'portfolio_id' => 1)), array('id' => 4, 'syfile_id' => 4, 'published' => false, 'name' => 'Item 4', 'ItemsPortfolio' => array('id' => 4, 'item_id' => 4, 'portfolio_id' => 1)), array('id' => 5, 'syfile_id' => 5, 'published' => false, 'name' => 'Item 5', 'ItemsPortfolio' => array('id' => 5, 'item_id' => 5, 'portfolio_id' => 1)));
     $this->assertEquals($expected, $result['Item']);
     $result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1)));
     $expected = array(array('ItemsPortfolio' => array('id' => 1, 'item_id' => 1, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 3, 'item_id' => 3, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 4, 'item_id' => 4, 'portfolio_id' => 1)), array('ItemsPortfolio' => array('id' => 5, 'item_id' => 5, 'portfolio_id' => 1)));
     $this->assertEquals($expected, $result);
     $Portfolio->delete(1);
     $result = $Portfolio->find('first', array('conditions' => array('Portfolio.id' => 1)));
     $this->assertFalse($result);
     $result = $Portfolio->ItemsPortfolio->find('all', array('conditions' => array('ItemsPortfolio.portfolio_id' => 1)));
     $this->assertEquals(array(), $result);
 }
Пример #9
0
 public function loadModel($id)
 {
     $model = Portfolio::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Пример #10
0
 public function removePortfolio($id)
 {
     $pf = Portfolio::getPfById($id);
     if ($pf && $pf->verifyOwner($this->userID)) {
         return $pf->removePf();
     }
     return false;
 }
Пример #11
0
function mobileValue($a, $b)
{
    if (Portfolio::isMobile()) {
        echo $a;
    } else {
        echo $b;
    }
}
 public function remove_portfolio($portfolioId = NULL)
 {
     if (!$this->securitypolicy->validateAccessRight(3, 'remove')) {
         $this->load->view('access_denied');
     }
     if ($this->input->post('portfolio-id')) {
         $portfolioId = $this->input->post('portfolio-id');
     }
     if (isset($portfolioId)) {
         $portfolio = new Portfolio();
         $portfolio->remove($portfolioId);
         $this->session->set_userdata(array('status' => 'success'));
         redirect(site_url('Admin/view_hotel_portfolio_list'));
     } else {
         show_error('Portfolio ID is missing');
     }
 }
Пример #13
0
 function prepare($args)
 {
     parent::prepare($args);
     $this->nickname = common_canonical_nickname($this->arg('nickname'));
     $this->user = User::staticGet('nickname', $this->nickname);
     $this->portfolio = Portfolio::staticGet('id', $this->arg('id'));
     return true;
 }
Пример #14
0
 /**
  * Set getter by name
  * 
  * @param string $name The set filename
  * @return Smak\Portfolio\Set | null
  */
 public function getByName($name)
 {
     parent::getByName($name);
     foreach ($this->getIterator() as $file_info) {
         if ($name == $file_info->getFilename()) {
             return new Set($file_info);
         }
     }
 }
    public function actionAddToGallery($modelPk, $imageName)
	{
		$img = new ImageGallery('create');
		$img->image_name = $imageName;
		$img->{Portfolio::getIdAttr()} = $modelPk;
		$img->makeThumb();
		$img->save();

		echo CJSON::encode(array('pk'=>$img->pk));
	}
Пример #16
0
 public function relations()
 {
    return CMap::mergeArray(parent::relations(), array(
        'portfolioWorks' => array(self::MANY_MANY, 'PortfolioWork', 'portfolio_works_relations(portfolio_id, portfolio_work_id)'),
        'gallery' => array(self::HAS_MANY, 'PortfolioGallery', Portfolio::getIdAttr(),
            'order'=>'gallery.sort ASC'
        ),
        'city' => array(self::BELONGS_TO, 'City', City::getIdAttr()),
        'workType' => array(self::BELONGS_TO, 'PortfolioWorkType', PortfolioWorkType::getIdAttr()),
    ));
 }
 protected function envPortfolio()
 {
     $portfolio = new Portfolio();
     $portfolio->picture = 'img/uploaded/2.jpg';
     $portfolio->title = 'My Project';
     $portfolio->description = 'This is my cute dog.';
     $portfolio->template_id = 1;
     $portfolio->save();
     $portfolio = new Portfolio();
     $portfolio->picture = 'img/uploaded/park.jpeg';
     $portfolio->title = 'My Project';
     $portfolio->description = 'This is my favorite park';
     $portfolio->template_id = 1;
     $portfolio->save();
     $portfolio2 = new Portfolio();
     $portfolio2->picture = 'img/uploaded/2.jpg';
     $portfolio2->title = 'My dog';
     $portfolio2->description = 'He is a cutie';
     $portfolio2->template_id = 2;
     $portfolio2->save();
     $portfolio21 = new Portfolio();
     $portfolio21->picture = 'img/uploaded/park.jpeg';
     $portfolio21->title = 'Best Park';
     $portfolio21->description = 'This is my favorite park';
     $portfolio21->template_id = 2;
     $portfolio21->save();
     $portfolio3 = new Portfolio();
     $portfolio3->picture = 'img/uploaded/2.jpg';
     $portfolio3->title = 'My Project';
     $portfolio3->description = 'Its pretty awesome';
     $portfolio3->template_id = 3;
     $portfolio3->save();
     $portfolio31 = new Portfolio();
     $portfolio31->picture = 'img/uploaded/park.jpeg';
     $portfolio31->title = 'My Project';
     $portfolio31->description = 'This is my favorite park';
     $portfolio31->template_id = 3;
     $portfolio31->save();
 }
Пример #18
0
    public function getWidget()
    {
        $box = new \Widgets\Box();
        $box->setId(\PortfolioHome::getInstance()->getId());
        $box->setTitle(\Portfolio::getInstance()->getText("Your Portfolio"));
        $box->setTitleLink(PATH_URL . "portfolio/");
        $box->setContent(<<<END
Hund
END
);
        $box->setContentMoreLink(PATH_URL . "portfolio/");
        return $box;
    }
Пример #19
0
	/**
	 * Manages all models.
	 */
	public function actionAdmin()
	{
		$all = Lookup::model()->getAll();
		Y::dump($all);
		$model = new Portfolio('search');
		$model->unsetAttributes();  // clear any default values
		$model = $model->current($cat);
		
		if (isset($_GET['Portfolio']))
			$model->attributes=$_GET['Portfolio'];
		
		if (isset($_GET['ajax'])) {
			$this->renderPartial('admingrid',array(
	            'model'=>$model,
		    ));
    	} else {
    		$this->render('admin',array(
				'model'=>$model,
    			'cat'=>$cat
    		));
		}
	}
Пример #20
0
 public function actionDelete($id)
 {
     $user = User::model()->findByPk((int) $id);
     //delete all portfolio of specified company
     $criteria = new CDbCriteria();
     $idcompany = (int) $user->company->id;
     $criteria->condition = "company_id={$idcompany}";
     Portfolio::model()->deleteAll($criteria);
     // delelte company
     Company::model()->deleteByPk($idcompany);
     // delete user
     $user->delete();
 }
Пример #21
0
 /**
  * Portfolio constructor.
  * @param array $config
  */
 public function __construct(array $config)
 {
     Portfolio::$app = $this;
     $this->config = $config;
     $this->slim = new \Slim\Slim(['view' => new \Slim\Views\Twig()]);
     $this->slim->view()->parserOptions = array('debug' => $config['debug'], 'cache' => $config['twig']['cacheDir']);
     $this->slim->view()->parserExtensions = array(new \Slim\Views\TwigExtension());
     $this->slim->view()->setTemplatesDirectory($config['twig']['templatesDir']);
     $this->client = new \ApiClient\Client($config['vk']);
     $this->storage = new \Storage\Storage(new \Predis\Client($config['redis']));
     $group = $this->storage->getById(new \Model\Group(), -$config['vk']['owner_id']);
     $this->slim->view()->appendData(['Group' => $group]);
     $this->slim->view()->appendData(['Meta' => $this->getMetaData($config['meta'])]);
 }
Пример #22
0
 public function actionIndex()
 {
     $type = Type::model()->findAll();
     $skill = Skill::model()->findAll();
     $usr = User::model()->findbyPk(1);
     $criteria = new CDbCriteria();
     $criteria->select = '*';
     $criteria->order = 'rand()';
     $total = Portfolio::model()->count();
     $pages = new CPagination($total);
     $pages->pageSize = 10;
     $pages->applyLimit($criteria);
     $port = Portfolio::model()->findAll($criteria);
     $this->render('index', array('type' => $type, 'port' => $port, 'pages' => $pages, 'skill' => $skill, 'usr' => $usr));
 }
Пример #23
0
 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     // renders the view file 'protected/views/site/index.php'
     // using the default layout 'protected/views/layouts/main.php'
     $this->layout = 'index';
     // one page about
     $criteriaAbout = new CDbCriteria(array('condition' => "t.key='about'"));
     $about = Pages::model()->findAll($criteriaAbout);
     // one page features
     $criteriaFeatures = new CDbCriteria(array('condition' => "t.key='features'"));
     $features = Pages::model()->findAll($criteriaFeatures);
     // one page portfolio
     $criteriaPortfolio = new CDbCriteria(array('condition' => "t.active='1'"));
     $portfolio = Portfolio::model()->findAll($criteriaPortfolio);
     $this->render('index', array('about' => $about, 'features' => $features, 'portfolio' => $portfolio));
 }
Пример #24
0
    public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
    {
        $rawHtml = new \Widgets\RawHtml();
        $boxManage = new \Widgets\PortfolioViewBox();
        $boxManage->setTitle(\Portfolio::getInstance()->getText("Belege verwalten"));
        $boxManage->setTitleLink($this->getExtension()->getExtensionUrl() . "ManageArtefacts/");
        $boxManage->setContent("this view helps in uploading and managing of desired artefacts");
        //$boxManage->setButtons(array(array("name"=>"Edit", "link"=>$this->getextension()->getExtensionUrl()."ManageArtefacts/"), array("name"=>"Manage Acess", "link"=>'')));
        /*
        $boxDiscuss = new \Widgets\PortfolioViewBox();
        $boxDiscuss->setTitle(gettext("Discuss View"));
        $boxDiscuss->setTitleLink($this->getextension()->getExtensionUrl()."ViewChart/");
        $boxDiscuss->setContent("Discuss view shows what other have commeted about ur artefacts.if needed this content  can be edited");
        $boxDiscuss->setButtons(array(array("name"=>"Edit", "link"=>"#"), array("name"=>"Manage Acess", "link"=>$this->getextension()->getExtensionUrl()."ManageArtefacts/")));
        */
        $boxcompetence = new \Widgets\PortfolioViewBox();
        $boxcompetence->setTitle(\Portfolio::getInstance()->getText("Kompetenzansicht"));
        $boxcompetence->setTitleLink($this->getextension()->getExtensionUrl() . "ViewCompetence/");
        $boxcompetence->setContent(" Competence view shows the grading of artifacts on the basis of comments given by friends and other group members");
        $boxcompetence->setButtons(array(array("name" => "Edit", "link" => "#"), array("name" => "Manage Acess", "link" => "#")));
        //TODO
        //		$box = new \Widgets\Box();
        //		$box->addWidget($boxManage);
        //		$box->addWidget($boxDiscuss);
        //		$box->addWidget($boxcompetence);
        $html = "";
        $html .= <<<END
    <div class="box" style="float: left; width: 316px;">
    <h3>{$this->portfolio->getName()}</h3>
    <br>
END;
        //		$html .= $box->getHtml();
        $html .= $boxManage->getHtml();
        //		$html .= $boxDiscuss->getHtml();
        $html .= $boxcompetence->getHtml();
        $html .= <<<END
    </div>
END;
        $rawHtml->setHtml($html);
        //$rawHtml->addWidget($box);
        $rawHtml->addWidget($boxManage);
        $rawHtml->addWidget($boxcompetence);
        $ajaxResponseObject->setStatus("ok");
        $ajaxResponseObject->addWidget($rawHtml);
        return $ajaxResponseObject;
    }
 /**
  * testHabtmRecursiveBelongsTo method
  *
  * @return void
  */
 public function testHabtmRecursiveBelongsTo()
 {
     $this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio', 'Syfile', 'Image');
     $Portfolio = new Portfolio();
     $result = $Portfolio->find('first', array('conditions' => array('id' => 2), 'recursive' => 3));
     $expected = array('Portfolio' => array('id' => 2, 'seller_id' => 1, 'name' => 'Portfolio 2'), 'Item' => array(array('id' => 2, 'syfile_id' => 2, 'published' => false, 'name' => 'Item 2', 'ItemsPortfolio' => array('id' => 2, 'item_id' => 2, 'portfolio_id' => 2), 'Syfile' => array('id' => 2, 'image_id' => 2, 'name' => 'Syfile 2', 'item_count' => null, 'Image' => array('id' => 2, 'name' => 'Image 2'))), array('id' => 6, 'syfile_id' => 6, 'published' => false, 'name' => 'Item 6', 'ItemsPortfolio' => array('id' => 6, 'item_id' => 6, 'portfolio_id' => 2), 'Syfile' => array('id' => 6, 'image_id' => null, 'name' => 'Syfile 6', 'item_count' => null, 'Image' => array()))));
     $this->assertEquals($expected, $result);
 }
 /**
  * testSaveHabtmNoPrimaryData method
  *
  * @return void
  */
 public function testSaveHabtmNoPrimaryData()
 {
     $this->loadFixtures('Article', 'User', 'Comment', 'Tag', 'ArticlesTag');
     $TestModel = new Article();
     $TestModel->unbindModel(array('belongsTo' => array('User'), 'hasMany' => array('Comment')), false);
     $result = $TestModel->findById(2);
     $expected = array('Article' => array('id' => '2', 'user_id' => '3', 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => '2007-03-18 10:43:31'), 'Tag' => array(array('id' => '1', 'tag' => 'tag1', 'created' => '2007-03-18 12:22:23', 'updated' => '2007-03-18 12:24:31'), array('id' => '3', 'tag' => 'tag3', 'created' => '2007-03-18 12:26:23', 'updated' => '2007-03-18 12:28:31')));
     $this->assertEquals($expected, $result);
     $TestModel->id = 2;
     $data = array('Tag' => array('Tag' => array(2)));
     $result = $TestModel->save($data);
     $this->assertEquals($data['Tag'], $result['Tag']);
     $result = $TestModel->findById(2);
     $expected = array('Article' => array('id' => '2', 'user_id' => '3', 'title' => 'Second Article', 'body' => 'Second Article Body', 'published' => 'Y', 'created' => '2007-03-18 10:41:23', 'updated' => self::date()), 'Tag' => array(array('id' => '2', 'tag' => 'tag2', 'created' => '2007-03-18 12:24:23', 'updated' => '2007-03-18 12:26:31')));
     $this->assertEquals($expected, $result);
     $this->loadFixtures('Portfolio', 'Item', 'ItemsPortfolio');
     $TestModel = new Portfolio();
     $result = $TestModel->findById(2);
     $expected = array('Portfolio' => array('id' => 2, 'seller_id' => 1, 'name' => 'Portfolio 2'), 'Item' => array(array('id' => 2, 'syfile_id' => 2, 'published' => '', 'name' => 'Item 2', 'ItemsPortfolio' => array('id' => 2, 'item_id' => 2, 'portfolio_id' => 2)), array('id' => 6, 'syfile_id' => 6, 'published' => '', 'name' => 'Item 6', 'ItemsPortfolio' => array('id' => 6, 'item_id' => 6, 'portfolio_id' => 2))));
     $this->assertEquals($expected, $result);
     $data = array('Item' => array('Item' => array(1, 2)));
     $TestModel->id = 2;
     $TestModel->save($data);
     $result = $TestModel->findById(2);
     $result['Item'] = Hash::sort($result['Item'], '{n}.id', 'asc');
     $expected = array('Portfolio' => array('id' => 2, 'seller_id' => 1, 'name' => 'Portfolio 2'), 'Item' => array(array('id' => 1, 'syfile_id' => 1, 'published' => '', 'name' => 'Item 1', 'ItemsPortfolio' => array('id' => 7, 'item_id' => 1, 'portfolio_id' => 2)), array('id' => 2, 'syfile_id' => 2, 'published' => '', 'name' => 'Item 2', 'ItemsPortfolio' => array('id' => 8, 'item_id' => 2, 'portfolio_id' => 2))));
     $this->assertEquals($expected, $result);
 }
 public function destacar()
 {
     //Aca se manda a la funcion editarItem de la clase Item
     //y se queda con la respuesta para redirigir cual sea el caso
     $respuesta = Portfolio::destacar(Input::all());
     /*
      if ($respuesta['error'] == true) {
      return Redirect::to('admin/producto')->withErrors($respuesta['mensaje'])->withInput();
      } else {
      return Redirect::to('admin/producto')->with('mensaje', $respuesta['mensaje']);
      }
     * 
     */
     if ($respuesta['error'] == true) {
         return Redirect::to('admin/' . $this->folder_name)->withErrors($respuesta['mensaje'])->withInput();
     } else {
         if (Input::get('continue') == "home") {
             return Redirect::to('/')->with('mensaje', $respuesta['mensaje']);
         } else {
             $menu = $respuesta['data']->item()->seccionItem()->menuSeccion()->url;
             $ancla = '#' . $respuesta['data']->item()->seccionItem()->estado . $respuesta['data']->item()->seccionItem()->id;
             return Redirect::to('/' . $menu)->with('mensaje', $respuesta['mensaje'])->with('ancla', $ancla);
         }
     }
 }
Пример #28
0
    public function frameResponse(\FrameResponseObject $frameResponseObject)
    {
        $breadcrumb = new \Widgets\Breadcrumb();
        $breadcrumb->setData(array(array("name" => \Portfolio::getInstance()->getText("Profile"), "link" => $this->getExtension()->getExtensionUrl() . "Profile/"), array("name" => \Portfolio::getInstance()->getText("Edit Profile"), "link" => $this->getExtension()->getExtensionUrl() . "Editprofile/"), array("name" => \Portfolio::getInstance()->getText("Add Employment experiance"))));
        $actionBar = new \Widgets\ActionBar();
        $actionBar->setActions(array(array("name" => \Portfolio::getInstance()->getText("Edit Profile"), "link" => $this->getExtension()->getExtensionUrl() . "Editprofile/"), array("name" => \Portfolio::getInstance()->getText("Qualification"), "link" => $this->getExtension()->getExtensionUrl() . "Qualificationprofile/"), array("name" => \Portfolio::getInstance()->getText("Employment History"), "link" => $this->getExtension()->getExtensionUrl() . "Employmentprofile/")));
        $input = new \Widgets\TextInput();
        $grid = new \Widgets\Grid();
        $grid->setData(array("headline" => array(array("name" => \Portfolio::getInstance()->getText("Employment  History"), "colspan" => "2")), "rows" => array(array(array("content" => \Portfolio::getInstance()->getText("Date Of Joining:"), "type" => "label"), array("content" => $input, "type" => "value")), array(array("content" => \Portfolio::getInstance()->getText("Till Date:"), "type" => "label"), array("content" => $input, "type" => "value")), array(array("content" => \Portfolio::getInstance()->getText("Organization Name:"), "type" => "label"), array("content" => $input, "type" => "value")), array(array("content" => \Portfolio::getInstance()->getText("Job Profile:"), "type" => "label"), array("content" => $input, "type" => "value")), array(array("content" => \Portfolio::getInstance()->getText("Work Details:"), "type" => "label"), array("content" => $input, "type" => "value")))));
        $actionBar2 = new \Widgets\ActionBar();
        $actionBar2->setActions(array(array("name" => \Portfolio::getInstance()->getText("Add More"), "link" => $this->getExtension()->getExtensionUrl() . ""), array("name" => \Portfolio::getInstance()->getText("Save"), "link" => $this->getExtension()->getExtensionUrl() . "")));
        $html = <<<end
<style type="text/css">

</style>

<div class="headline">
\t<h1>Add Working Experiance</h1>
</div>

<div class="actionBar">
    
\t<a href="../Editprofile/"class="button">Edit profile</a>
\t
\t<a href="../qualificationprofile/" class="button">Qualification icon</a>
\t
\t<a href="#" class="button">Employment History</a>
\t
</div>

<ul class="tabBar">
        
    <li class="tabIn"><a href="./..">Dashboard</a></li>
        
    <li class="tabOut"><a href="../profile/"">Profile</a></li>
        
    <li class="tabIn"><a href="../myportfolio/">Portfolio</a></li>
        
    <li class="tabIn"><a href="../groups/">Groups</a></li>
    
    <li style="clear: left;">
</li></ul>
<br>

<table class="grid" cellspacing="0" cellpadding="5" width="100%">

\t 
\t <tr>
<td class="label">Date of joining:</td>
\t<td class="value">
\t\t<input type="text" value="date of joining the job" " size="30" >
</td>
</tr>
<tr>
<td class="label">Till Date:</td>
<td class="value">
<input type="text" value="till when u worked in the job" "size="30" name="user_full_name">
</td>
</tr>
<tr>
<td class="label">Company Name:</td>
<td class="value">
\t\t<input type="text" value="Name of the organization"" size="30" >
</td>
</tr>

<tr>
<td class="label">Job Profile :</td>
<td class="value">
\t\t<input type="text" value=""" size="30" >
</td>
</tr>
<td class="label">Job Details:</td>
<td class="value">
<textarea wrap="virtual" rows="10" style="width: 70%;" name="values[USER_qualification_DSC]"></textarea>
<br>
<a class="textformat_button" title="boldface" href="javascript:insert('[b]', '[/b]', 'formular', 'values[USER_PROFILE_DSC]')">
<b>B</b>
</a>
<a class="textformat_button" title="italic" href="javascript:insert('[i]', '[/i]', 'formular', 'values[USER_PROFILE_DSC]')">
<i>I</i>
</a>
<a class="textformat_button" title="underline" href="javascript:insert('[u]', '[/u]', 'formular', 'values[USER_PROFILE_DSC]')">
<u>U</u>
</a>
<a class="textformat_button" title="strikethrough" style="text-decoration: line-through;" href="javascript:insert('[s]', '[/s]', 'formular', 'values[USER_PROFILE_DSC]')">S</a>
<a class="textformat_button" title="image" href="javascript:insert('[img]http://', '[/img]', 'formular', 'values[USER_PROFILE_DSC]')">IMG</a>
<a class="textformat_button" title="web link" href="javascript:insert('[url=http://]', '[/url]', 'formular', 'values[USER_PROFILE_DSC]')">URL</a>
<a class="textformat_button" title="email link" href="javascript:insert('[mail=@]', '[/mail]', 'formular', 'values[USER_PROFILE_DSC]')">MAIL</a>
</td>
</tr>
\t
\t</td>
\t</tr>
\t </table><div class="buttons">
<a class="button">Save</a>
</div>
\t <br>
\t <div class="buttons">
<a class="button">Add More</a>
</div>



\t

end;
        $frameResponseObject->setTitle("employmentprofile");
        $rawHtml = new \Widgets\RawHtml();
        $rawHtml->setHtml($html);
        $frameResponseObject->addWidget($breadcrumb);
        //$frameResponseObject->addWidget($actionBar);
        $frameResponseObject->addWidget($grid);
        $frameResponseObject->addWidget($actionBar2);
        //$frameResponseObject->addWidget($rawHtml);
        return $frameResponseObject;
    }
Пример #29
0
<?php

$this->widget('application.extensions.tooltipster.tooltipster', array('identifier' => '#show_tooltip', 'options' => array('position' => 'bottom')));
foreach ($model as $item) {
    $c = Portfolio::model()->findByPk($item->portfolio_id);
    if ($c->picture == $item->file) {
        $chk = 'checked';
    } else {
        $chk = '';
    }
    ?>
    <div class="data_<?php 
    echo $item->id;
    ?>
">
        <figure class="cabinet__photo__item2">
            <a href="/users/<?php 
    echo Yii::app()->user->id;
    ?>
/<?php 
    echo $item->file;
    ?>
" rel="gallery1" class="photo__zoom">
                <img src="/users/<?php 
    echo Yii::app()->user->id;
    ?>
/370_<?php 
    echo $item->file;
    ?>
" alt="">
            </a>
Пример #30
0
 public function getNameSlug()
 {
     return Portfolio::slugify($this->getName());
 }