Example #1
0
function addGroup($type, $id, $groupid)
{
    if (ItemGroupHandler::setChildren($groupid, array($id), $type)) {
        $group = new ItemGroup();
        $group->load($groupid);
        $g = array();
        $g['id'] = $group->id;
        $g['name'] = $group->getProperty('name');
        $g['color'] = $group->params['color'];
        $g['group'] = '<strong>' . $group->id . '</strong>';
        HTML_AcctExp::groupRow($type, $g);
    }
}
Example #2
0
    /**
     * @param aecHTML $aecHTML
     * @param ItemGroup $row
     */
    static function editItemGroup($aecHTML, $row)
    {
        HTML_myCommon::startCommon('aec-wrap-squary', 'aec-wrap-inner-light');
        HTML_myCommon::startForm();
        HTML_myCommon::getHeader('AEC_HEAD_ITEMGROUP_INFO', 'itemgroups', $row->id ? $row->name : JText::_('AEC_CMN_NEW'), false, 'edit', 'ItemGroup');
        ?>
<div class="col-sm-12"><?php 
        $tabs = new bsPaneTabs();
        $tabs->startTabs();
        $tabs->newTab('group', JText::_('ITEMGROUP_DETAIL_TITLE'));
        $tabs->newTab('restrictions', JText::_('ITEMGROUP_RESTRICTIONS_TITLE'));
        $tabs->newTab('mis', JText::_('AEC_USER_MICRO_INTEGRATION'));
        $tabs->endTabs();
        $tabs->startPanes();
        $tabs->nextPane('group');
        ?>
		<div class="row">
			<div class="col-sm-4">
				<section class="paper">
					<h4>General</h4>
					<?php 
        echo $aecHTML->createSettingsParticle('active');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('visible');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('color');
        ?>
					<div style="position:relative;width:100%;">
						<?php 
        echo $aecHTML->createSettingsParticle('name');
        if ($row->id) {
            ?>
							<p><a href="<?php 
            echo str_replace("/administrator/", "/", AECToolbox::deadsureURL('index.php?option=com_acctexp&task=subscribe&group=' . $row->id));
            ?>
" title="<?php 
            echo JText::_('AEC_CGF_LINK_ABO_FRONTEND');
            ?>
" target="_blank"><?php 
            echo JText::_('AEC_CGF_LINK_ABO_FRONTEND');
            ?>
</a></p>
						<?php 
        }
        ?>
					</div>
				</section>
				<section class="paper">
					<h4><?php 
        echo JText::_('ITEMGROUPS_PARENTGROUP_TITLE');
        ?>
</h4>
					<?php 
        if ($row->id > 1) {
            ?>
						<table style="width:100%;" class="table table-striped table-hover table-condensed aec-grouplist">
							<thead>
							<tr>
								<th>Name</th>
								<th></th>
							</tr>
							</thead>
							<tbody>
							<?php 
            if (!empty($aecHTML->customparams->groups)) {
                foreach ($aecHTML->customparams->groups as $id => $group) {
                    HTML_AcctExp::groupRow('group', $group);
                }
            }
            ?>
							</tbody>
							<tfoot>
							<tr>
								<td><?php 
            echo $aecHTML->createSettingsParticle('add_group');
            ?>
</td>
								<td>
									<a class="btn btn-success pull-right" id="addgroup-btn" onClick="addGroup('group','addgroup-btn')"><?php 
            echo aecHTML::Icon('plus');
            ?>
</a>
								</td>
							</tr>
							</tfoot>
						</table>
					<?php 
        } elseif ($row->id == 1) {
            ?>
						<p>This is the Root Group.</p>
					<?php 
        } else {
            ?>
						<p>You can select Parent Groups after you have saved this for the first time.</p>
					<?php 
        }
        ?>
				</section>
			</div>
			<div class="col-sm-8">
				<section class="paper">
					<h4>Details</h4>
					<?php 
        echo $aecHTML->createSettingsParticle('reveal_child_items');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('symlink');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('symlink_userid');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('notauth_redirect');
        ?>
					<?php 
        echo $aecHTML->createSettingsParticle('desc');
        ?>
				</section>
			</div>
		</div>
		<?php 
        $tabs->nextPane('restrictions');
        ?>
		<?php 
        echo aecRestrictionHelper::echoSettings($aecHTML);
        ?>
		<?php 
        $tabs->nextPane('mis');
        ?>
		<div class="row">
			<div class="col-sm-6">
				<section class="paper">
					<h4><?php 
        echo JText::_('Inherited Micro Integrations');
        ?>
</h4>
					<?php 
        if ($row->id > 1) {
            if (!empty($aecHTML->customparams->mi['inherited'])) {
                echo '<p>' . JText::_('These MIs were inherited from groups that this group is in') . '</p>';
                echo '<ul>';
                foreach ($aecHTML->customparams->mi['inherited'] as $id => $mi) {
                    ?>
								<li>
									<p>
										<input type="checkbox" name="inherited_micro_integrations[]" value="<?php 
                    echo $mi->id;
                    ?>
" checked="checked" disabled="disabled" />
										<strong><?php 
                    echo $mi->name;
                    ?>
</strong> (#<?php 
                    echo $mi->id;
                    ?>
)
										(<a href="index.php?option=com_acctexp&amp;task=edit&amp;entity=microintegration&amp;id=<?php 
                    echo $mi->id;
                    ?>
" target="_blank"><?php 
                    echo JText::_('edit');
                    ?>
</a>)
									</p>
									<p><?php 
                    echo $mi->desc;
                    ?>
</p>
								</li>
							<?php 
                }
                echo '</ul>';
            } else {
                echo '<p>' . JText::_('No inherited MIs - A group can inherit MIs from groups that it is in') . '</p>';
            }
        }
        ?>
				</section>
			</div>

			<div class="col-sm-6">
				<section class="paper">
					<h4><?php 
        echo JText::_('Attached Micro Integrations');
        ?>
</h4>
					<?php 
        if (!empty($aecHTML->customparams->mi['attached'])) {
            echo '<table style="margin: 0 auto;">';
            foreach ($aecHTML->customparams->mi['attached'] as $id => $mi) {
                ?>
							<tr>
								<td>
									<h5>
										<strong><?php 
                echo $mi->name;
                ?>
</strong>
										(#<?php 
                echo $mi->id;
                ?>
)
										<?php 
                echo $mi->inherited ? ' (' . JText::_('inherited from group, see above') . '!)' : '';
                ?>
										(<a href="index.php?option=com_acctexp&amp;task=edit&amp;entity=microintegration&amp;id=<?php 
                echo $mi->id;
                ?>
" target="_blank"><?php 
                echo JText::_('edit');
                ?>
</a>)
									</h5>
								</td>
								<td>
									<input type="hidden" name="micro_integrations[]" value="0" />
									<input id="micro_integrations_<?php 
                echo $mi->id;
                ?>
" class="bootstrap-toggle" type="checkbox" name="micro_integrations[]"<?php 
                echo $mi->attached ? ' checked="checked"' : '';
                ?>
 value="<?php 
                echo $mi->id;
                ?>
" data-state="<?php 
                echo $mi->attached ? '1' : '0';
                ?>
"/>
								</td>
							</tr>
							<tr>
								<td colspan="2" style="border-bottom: 1px dashed #999;">
									<p><?php 
                echo $mi->desc;
                ?>
</p>
								</td>
							</tr>
						<?php 
            }
            echo '</table>';
        } else {
            echo '<p>' . JText::_('No MIs to attach') . '<a href="index.php?option=com_acctexp&amp;task=edit&amp;entity=microintegration" target="_blank">(' . JText::_('create one now?') . ')</a></p>';
        }
        ?>
				</section>
			</div>
		</div>
		<?php 
        $tabs->endPanes();
        ?>
		<br />
		<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
		<input type="hidden" name="option" value="com_acctexp" />
		<input type="hidden" name="entity" value="ItemGroup" />
		<input type="hidden" name="task" value="save" />
		</form>

		</div>

		<?php 
        HTML_myCommon::endCommon();
    }