port of the event attendance feature of red matrix with example implementation for vier theme.

This commit is contained in:
rabuzarus 2015-09-30 16:58:02 +02:00
commit 7cb4ea52fd
12 changed files with 7 additions and 133 deletions

View file

@ -123,10 +123,6 @@ function editpost_content(&$a) {
'$noloc' => t('Clear browser location'),
'$shortnoloc' => t('clear location'),
'$voting' => t('Toggle voting'),
'$feature_voting' => $voting,
// we need a solution for the red flags to make consensus work
'$consensus' => (($itm[0]['item_flags'] & ITEM_CONSENSUS) ? 1 : 0),
'$wait' => t('Please wait'),
'$permset' => t('Permission settings'),
'$ptyp' => $itm[0]['type'],

View file

@ -51,7 +51,6 @@ function item_post(&$a) {
$message_id = ((x($_REQUEST,'message_id') && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
$consensus = intval($_REQUEST['consensus']);
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
@ -656,15 +655,6 @@ function item_post(&$a) {
if(!$thr_parent)
$thr_parent = $uri;
/* *
* to make consensus work, red requests the consensus flag from boot.php
* this have to be inserted into the lower $datarray
*
* if($consensus)
* $item_flags |= ITEM_CONSENSUS;
*/
$datarray = array();
$datarray['uid'] = $profile_uid;
$datarray['type'] = $post_type;

View file

@ -26,18 +26,6 @@ function like_content(&$a) {
case 'undislike':
$activity = ACTIVITY_DISLIKE;
break;
case 'agree':
case 'unagree':
$activity = ACTIVITY_AGREE;
break;
case 'disagree':
case 'undisagree':
$activity = ACTIVITY_DISAGREE;
break;
case 'abstain':
case 'unabstain':
$activity = ACTIVITY_ABSTAIN;
break;
case 'attendyes':
case 'unattendyes':
$activity = ACTIVITY_ATTEND;
@ -134,14 +122,11 @@ function like_content(&$a) {
$verbs = " '".dbesc($activity)."' ";
// event participation and consensus items are essentially radio toggles. If you make a subsequent choice,
// event participation are essentially radio toggles. If you make a subsequent choice,
// we need to eradicate your first choice.
if($activity === ACTIVITY_ATTEND || $activity === ACTIVITY_ATTENDNO || $activity === ACTIVITY_ATTENDMAYBE) {
$verbs = " '" . dbesc(ACTIVITY_ATTEND) . "','" . dbesc(ACTIVITY_ATTENDNO) . "','" . dbesc(ACTIVITY_ATTENDMAYBE) . "' ";
}
if($activity === ACTIVITY_AGREE || $activity === ACTIVITY_DISAGREE || $activity === ACTIVITY_ABSTAIN) {
$verbs = " '" . dbesc(ACTIVITY_AGREE) . "','" . dbesc(ACTIVITY_DISAGREE) . "','" . dbesc(ACTIVITY_ABSTAIN) . "' ";
}
$r = q("SELECT `id`, `guid` FROM `item` WHERE `verb` IN ( $verbs ) AND `deleted` = 0
AND `contact-id` = %d AND `uid` = %d
@ -202,12 +187,6 @@ EOT;
$bodyverb = t('%1$s likes %2$s\'s %3$s');
if($verb === 'dislike')
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
if($verb === 'agree')
$bodyverb = t('%1$s agrees with %2$s\'s %3$s');
if($verb === 'disagree')
$bodyverb = t('%1$s doesn\'t agree with %2$s\'s %3$s');
if($verb === 'abstain')
$bodyverb = t('%1$s abstains from a decision on %2$s\'s %3$s');
if($verb === 'attendyes')
$bodyverb = t('%1$s is attending %2$s\'s %3$s');
if($verb === 'attendno')

View file

@ -1603,7 +1603,6 @@ function photos_content(&$a) {
$conv_responses = array(
'like' => array('title' => t('Likes','title')),'dislike' => array('title' => t('Dislikes','title')),
'agree' => array('title' => t('Agree','title')),'disagree' => array('title' => t('Disagree','title')), 'abstain' => array('title' => t('Abstain','title')),
'attendyes' => array('title' => t('Attending','title')), 'attendno' => array('title' => t('Not attending','title')), 'attendmaybe' => array('title' => t('Might attend','title'))
);