Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
frontend and acp
Browse files Browse the repository at this point in the history
  • Loading branch information
Clausi committed Oct 9, 2014
1 parent 1d1dcca commit de36cad
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 45 deletions.
9 changes: 3 additions & 6 deletions acp/main_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,14 @@ function main($id, $mode)

$schema_id = 1;

$db->sql_freeresult($result);

// Create add form
$sql = "SELECT * FROM " . $phpbb_container->getParameter('tables.clausi.rcm_schema_data') . " WHERE schema_id = '".$schema_id."'";
$result = $db->sql_query($sql);

while($row = $db->sql_fetchrow($result))
{
if($row['type'] === 'role')
{
$template->assign_block_vars('roles', array(
$template->assign_block_vars('n_roles', array(
'ID' => $row['id'],
'NAME' => $row['name']
));
Expand Down Expand Up @@ -119,7 +116,7 @@ function main($id, $mode)

$url = $this->u_action . "&recruit_id=".$row_recruit['id'];

$template->assign_block_vars('roles.recruit', array(
$template->assign_block_vars('n_roles.n_recruit', array(
'ID' => $row_recruit['id'],
'ROLE' => $row['name'],
'CLASS' => $class_name,
Expand All @@ -132,7 +129,7 @@ function main($id, $mode)
}
else if($row['type'] === 'class')
{
$template->assign_block_vars('classes', array(
$template->assign_block_vars('n_classes', array(
'ID' => $row['id'],
'NAME' => $row['name']
));
Expand Down
30 changes: 15 additions & 15 deletions adm/style/recruitment_recruit.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<!-- INCLUDE overall_header.html -->

<h1>{L_ACP_RECRUITMENT}</h1>
<!-- BEGIN roles -->
<!-- IF roles.recruit -->
<!-- BEGIN n_roles -->
<!-- IF .n_roles.n_recruit -->
<table class="table1">
<col class="row1" /><col class="row1" /><col class="row2" />
<thead>
<tr>
<th colspan="2">{roles.NAME}</th>
<th colspan="2">{n_roles.NAME}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN recruit -->
<!-- BEGIN n_recruit -->
<tr>
<td class="forum-desc">
<strong>{roles.recruit.CLASS}</strong>
<br /><span>{roles.recruit.URGENCY}</span>
<strong>{n_roles.n_recruit.CLASS}</strong>
<br /><span>{n_roles.n_recruit.URGENCY}</span>
</td>
<td class="actions">
<a href="{recruit.U_DELETE}">{ICON_DELETE}</a>
<a href="{n_recruit.U_DELETE}">{ICON_DELETE}</a>
</td>
</tr>
<!-- END recruit -->
<!-- END n_recruit -->
</tbody>
</table>
<!-- ENDIF -->
<!-- END roles -->
<!-- END n_roles -->

<form id="recruitment" method="post" action="{U_ACTION}">

Expand All @@ -34,15 +34,15 @@ <h1>{L_ACP_RECRUITMENT}</h1>
<input type="hidden" name="schema" value="{RECRUITMENT_SCHEMA_ID}" />

<select name="role">
<!-- BEGIN roles -->
<option value="{roles.ID}">{roles.NAME}</option>
<!-- END roles -->
<!-- BEGIN n_roles -->
<option value="{n_roles.ID}">{n_roles.NAME}</option>
<!-- END n_roles -->
</select>

<select name="class">
<!-- BEGIN classes -->
<option value="{classes.ID}">{classes.NAME}</option>
<!-- END classes -->
<!-- BEGIN n_classes -->
<option value="{n_classes.ID}">{n_classes.NAME}</option>
<!-- END n_classes -->
</select>

<select name="urgency">
Expand Down
54 changes: 53 additions & 1 deletion event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,59 @@ public function load_language_on_setup($event)

public function create_recruitment_block($event)
{
global $db, $user, $config;
global $db, $user, $config, $phpbb_container;

$schema_id = 1;

$sql = "SELECT * FROM " . $phpbb_container->getParameter('tables.clausi.rcm_schema_data') . " WHERE schema_id = '".$schema_id."'";
$result = $db->sql_query($sql);

while($row = $db->sql_fetchrow($result))
{
if($row['type'] === 'role')
{
$this->template->assign_block_vars('n_roles', array(
'ID' => $row['id'],
'NAME' => $row['name']
));

$sql = "SELECT * FROM " . $phpbb_container->getParameter('tables.clausi.rcm_recruit') . " WHERE schema_id = '".$schema_id."' AND role = '".$row['id']."' ORDER BY class";
$result_recruit = $db->sql_query($sql);
while($row_recruit = $db->sql_fetchrow($result_recruit))
{
$sql = "SELECT * FROM " . $phpbb_container->getParameter('tables.clausi.rcm_schema_data') . " WHERE schema_id = '".$schema_id."' AND type = 'class'";
$result_class = $db->sql_query($sql);
while($row_class = $db->sql_fetchrow($result_class))
{
if($row_class['id'] === $row_recruit['class'])
{
$class_name = $row_class['name'];
}
}
$db->sql_freeresult($result_class);

switch($row_recruit['urgency']) {
case 0:
$urgency = $user->lang('RECRUITMENT_LOW');
break;
case 1:
$urgency = $user->lang('RECRUITMENT_MID');
break;
default:
$urgency = $user->lang('RECRUITMENT_HIGH');
}

$this->template->assign_block_vars('n_roles.n_recruit', array(
'ID' => $row_recruit['id'],
'ROLE' => $row['name'],
'CLASS' => $class_name,
'URGENCY' => $urgency,
));
}

$db->sql_freeresult($result_recruit);
}
}

$this->template->assign_vars(array(
'S_RECRUITMENT_BLOCK_ACTIVE' => $config['clausi_recruitment_active']
Expand Down
1 change: 1 addition & 0 deletions language/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'RECRUITMENT_LOW' => 'Low',
'RECRUITMENT_MID' => 'Medium',
'RECRUITMENT_HIGH' => 'High',
'NO_RECRUITMENT' => 'Recruitment is closed.',

'ACP_RECRUITMENT_TITLE' => 'Recruitment Module',
'ACP_RECRUITMENT_SETTINGS' => 'Settings',
Expand Down
20 changes: 13 additions & 7 deletions styles/prosilver/template/recruitment_block.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
</dl>
</li>
</ul>
<ul class="topiclist sidebar">
<li class="bg1">Row</li>
<li class="bg2">Row</li>
<li class="bg1">Row</li>
<li class="bg2">Row</li>
<li class="bg1">Row</li>
</ul>
<!-- BEGIN n_roles -->
<!-- IF .n_roles.n_recruit -->
<ul class="topiclist">
<li class="bg1">{n_roles.NAME}
<ul class="topiclist">
<!-- BEGIN n_recruit -->
<li class="bg1">{n_roles.n_recruit.CLASS}</li>
<!-- END n_recruit -->
</ul>
</li>
</ul>
<!-- ENDIF -->
<!-- END n_roles -->
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- INCLUDE recruitment_block.html -->
36 changes: 20 additions & 16 deletions styles/puritytheme/template/recruitment_block.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<!-- IF S_DISPLAY_RECRUITMENT_BLOCK -->
<!-- IF S_RECRUITMENT_BLOCK_ACTIVE -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><a href="http://www.wowprogress.com/guild/{REGION}/{REALM}/{GUILD}" title="{GUILD} - Rekrutierung">Rekrutierung</a></h3>
<h3 class="panel-title"><a href="http://www.wowprogress.com/guild/{REGION}/{REALM}/{GUILD}" title="{GUILD} - Rekrutierung">{L_RECRUITMENT_TITLE}</a></h3>
</div>
<div class="panel-body">
<!-- BEGIN n_recruitment -->
{n_recruitment.GERMANROLES}<br />
<div>
<!-- BEGIN n_classes -->
<div>
<div>{n_recruitment.n_classes.CLASS}<!-- IF n_recruitment.ROLES == 'damage' --> ~ {n_recruitment.n_classes.SPEC}<!-- ENDIF --></div>
</div>
<!-- END n_classes -->
</div>
<br />
<!-- END n_recruitment -->
</div>
<div class="panel-footer">
<!-- IF S_STARTPAGE --><a href="apply.php" title="Bewerbung">Bewerbung im Forum</a> oder schreibt uns persönlich an!<!-- ENDIF -->
<!-- BEGIN n_roles -->
<!-- IF .n_roles.n_recruit -->
<ul>
<li>{n_roles.NAME}
<ul>
<!-- BEGIN n_recruit -->
<li>{n_roles.n_recruit.CLASS}</li>
<!-- END n_recruit -->
</ul>
</li>
</ul>
<!-- ENDIF -->
<!-- END n_roles -->
</div>
<!-- IF S_STARTPAGE -->
<div class="panel-footer">
<a href="apply.php" title="Bewerbung">Bewerbung im Forum</a> oder schreibt uns persönlich an!
</div>
<!-- ENDIF -->
</div>
<!-- ENDIF -->

0 comments on commit de36cad

Please sign in to comment.