diff --git a/2019/user.php b/2019/user.php index e4319e1..6566e94 100644 --- a/2019/user.php +++ b/2019/user.php @@ -1,318 +1,321 @@ . require 'load.php'; $conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID ) ->queryRow(); if( !$conference ) { die_with_404(); } $user = User::factoryByUID( $_GET['uid'] ) ->select( [ User::ID, User::UID, User::GRAVATAR, User::NAME, User::SURNAME, User::IMAGE, User::WEBSITE, User::LOVED_LICENSE, User::BIO_L10N(), ] ) ->select( User::allSocialFields() ) ->queryRow(); if( !$user ) { die_with_404(); } enqueue_js('jquery'); template( 'header', [ 'conference' => $conference, 'title' => $user->getUserFullname(), 'canonical' => $user->getUserURL( true ), 'og' => [ 'image' => $user->getUserImage( true ), 'type' => 'profile', 'profile:first_name' => $user->get( 'user_name' ), 'profile:last_name' => $user->get( 'user_surname' ), ] ] ); ?>

getUserFullName() ) ?>

hasPermissionToEditUser() ): ?>

getUserUID()}", __("Modifica") . icon('edit', 'left') ) ?>

has( User::WEBSITE ) ): ?> <?= esc_html(
 								$user->getUserFullname()
 							) ?> has( User::WEBSITE ) ): ?>
user_site ): ?>

user_site, __("Sito personale") . icon('inbox', 'right'), null, 'btn waves-effect purple darken-2', 'target="_blank"' ) ?>

- factoryUserSkills() + whereUser( $user ) + ->joinSkill() + ->orderBySkillUID() ->queryGenerator(); ?> valid() ): ?>

getSkillCode() ) ?>
hasUserLovelicense() ): ?>
getUserLovelicense() ?>

%s."), $license->getLink() ) ?>

hasUserBio() ): ?>

getUserBioHTML( ['p' => 'flow-text'] ) ?>

select( Conference::fields() ) ->select( Event ::fields() ) ->select( Chapter ::fields() ) ->select( Track ::fields() ) ->select( Room ::fields() ) ->whereConference( $conference ) ->whereUser( $user ) ->joinConference() ->joinTrackChapterRoom() ->queryGenerator(); ?> valid() ): ?>
getEventURL(), sprintf( "%s", esc_html( $title = $event->getEventTitle() ) ), sprintf( __("Vedi %s"), $title ) ) ?> getChapterName() ) ?> getTrackName() ) ?> getLocationName() ) ?>
getRoomName() ) ?>
%s (il %s)"), $event->getEventStart("H:i"), $event->getEventStart("d/m/Y") ) ?>
getEventHumanStart() ?>

joinConference() ->joinLocation() ->joinChapter() ->whereUser( $user ) ->whereConferenceNot( $conference ) ->orderBy( Event::START, 'DESC' ) ->queryGenerator(); ?> valid() ): ?>

hasConferenceEventsURL() ) { // print the Event permalink echo HTML::a( $event->getEventURL(), esc_html( $event->getEventTitle() ) ); } else { // just print the Event title echo esc_html( $event->getEventTitle() ); } ?> getConferenceURL(), esc_html( $event->getConferenceTitle() ) ) ?> getLocationName() ) ?>
getEventStart( __( "d/m/Y" ) ) ) ?>
getEventHumanStart() ?>
isUserSocial() ): ?>

has( User::RSS ) and UserSocialBox::spawn( $user, "RSS", $user->get( User::RSS ), 'home.png' ); $user->has( User::FACEBOOK ) and UserSocialBox::spawn( $user, "Facebook", $user->getUserFacebruck(), 'facebook_logo.png' ); $user->has( User::GOOGLE_PLUS ) and UserSocialBox::spawn( $user, "Google+", $user->getUserGuggolpluz(), 'google.png' ); $user->has( User::TWITTER ) and UserSocialBox::spawn( $user, "Twitter", $user->getUserTuitt(), 'twitter.png' ); $user->has( User::LINKEDIN ) and UserSocialBox::spawn( $user, "Linkedin", $user->getUserLinkeddon(), 'linkedin.png' ); $user->has( User::GITHUB ) and UserSocialBox::spawn( $user, "Github", $user->getUserGithubbo(), 'github.png' ); ?>
true, ] ); diff --git a/includes/class-QuerySkill.php b/includes/class-QuerySkill.php index 43b6c17..6371768 100644 --- a/includes/class-QuerySkill.php +++ b/includes/class-QuerySkill.php @@ -1,78 +1,98 @@ . trait QuerySkillTrait { /** * Where the Skill is the specified one * * @param object $skill * @return self */ public function whereSkill( $skill ) { return $this->whereSkillID( $skill->getSkillID() ); } /** * Where the Skil ID is the specified one * * @param int $id Skill ID * @return self */ public function whereSkillID( $id ) { return $this->whereInt( $this->SKILL_ID, $id ); } /** * Where the Skill UID is the specified one * * @param string $uid Skill UID * @return self */ public function whereSkillUID( $uid ) { return $this->whereStr( 'skill_uid', $uid ); } + /** + * Join a table with the Skill table + * + * @param string $join Join type + * @return self + */ + public function joinSkill( $join = 'INNER' ) { + return $this->joinOn( $join, Skill::T, $this->SKILL_ID, 'skill.skill_ID' ); + } + + /** + * Order by the Skill UID + * + * @param string $direction Order direction (DESC|ASC) + * @return self + */ + public function orderBySkillUID( $direction = null ) { + return $this->orderBy( Skill::UID, $direction ); + } + } /** * Query a Skill */ class QuerySkill extends Query { use QuerySkillTrait; /** * Univoque Skill ID column name */ protected $SKILL_ID = 'skill.skill_ID'; /** * Constructor * * @param DB $db Database connection */ public function __construct( $db = null ) { // set database and default result class parent::__construct( $db = null, Skill::class ); // set table FROM $this->from( Skill::T ); } }