--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'>Client <TMPL_VAR Name></h1>
+ </div>
+ <div class='bodydiv'>
+<form name="client" action='?' method='GET'>
+ <input type='hidden' name='client' value=<TMPL_VAR qclient>>
+ <table id='id<TMPL_VAR ID>'></table>
+ <div class="otherboxtitle">
+ Actions
+ </div>
+ <div class="otherbox">
+ <button type="submit" class="bp" name='action' value='client_save' title="Apply"> <img src='/bweb/apply.png' alt=''>Apply</button>
+ </div>
+
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Group Name", "Description", "Selection");
+
+var data = new Array();
+var radiobox ;
+
+<TMPL_LOOP client_group>
+radiobox = document.createElement('INPUT');
+radiobox.type = 'radio';
+radiobox.name = 'client_group';
+radiobox.value = '<TMPL_VAR client_group_name>';
+radiobox.checked = <TMPL_IF here>1<TMPL_ELSE>0</TMPL_IF>;
+
+data.push(
+ new Array( "<TMPL_VAR client_group_name>",
+ "<TMPL_VAR comment>",
+ radiobox
+ )
+) ;
+</TMPL_LOOP>
+
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+ rows_per_page: rows_per_page,
+ disable_sorting: new Array(1)
+}
+);
+</script>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'>Client <TMPL_VAR Name></h1>
+ </div>
+ <div class='bodydiv'>
+<form name="client" action='?' method='GET'>
+ <input type='hidden' name='client' value=<TMPL_VAR qclient>>
+ <table id='id<TMPL_VAR ID>'></table>
+ <div class="otherboxtitle">
+ Actions
+ </div>
+ <div class="otherbox">
+ <button type="submit" class="bp" name='action' value='client_save' title="Apply"> <img src='/bweb/apply.png' alt=''>Apply</button>
+ </div>
+
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Group Name", "Description", "Selection");
+
+var data = new Array();
+var radiobox ;
+
+<TMPL_LOOP client_group>
+radiobox = document.createElement('INPUT');
+radiobox.type = 'radio';
+radiobox.name = 'client_group';
+radiobox.value = '<TMPL_VAR client_group_name>';
+radiobox.checked = <TMPL_IF here>1<TMPL_ELSE>0</TMPL_IF>;
+
+data.push(
+ new Array( "<TMPL_VAR client_group_name>",
+ "<TMPL_VAR comment>",
+ radiobox
+ )
+) ;
+</TMPL_LOOP>
+
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+ rows_per_page: rows_per_page,
+ disable_sorting: new Array(1)
+}
+);
+</script>
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'>Client <TMPL_VAR Name></h1>
+ </div>
+ <div class='bodydiv'>
+<form name="client" action='?' method='GET'>
+ <input type='hidden' name='client' value=<TMPL_VAR qclient>>
+ <table id='id<TMPL_VAR ID>'></table>
+ <div class="otherboxtitle">
+ Actions
+ </div>
+ <div class="otherbox">
+ <button type="submit" class="bp" name='action' value='client_save' title="Appliquer"> <img src='/bweb/apply.png' alt=''>Appliquer</button>
+ </div>
+
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("Group Name", "Description", "Sélection");
+
+var data = new Array();
+var radiobox ;
+
+<TMPL_LOOP client_group>
+radiobox = document.createElement('INPUT');
+radiobox.type = 'radio';
+radiobox.name = 'client_group';
+radiobox.value = '<TMPL_VAR client_group_name>';
+radiobox.checked = <TMPL_IF here>1<TMPL_ELSE>0</TMPL_IF>;
+
+data.push(
+ new Array( "<TMPL_VAR client_group_name>",
+ "<TMPL_VAR comment>",
+ radiobox
+ )
+) ;
+</TMPL_LOOP>
+
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+ rows_per_page: rows_per_page,
+ disable_sorting: new Array(1)
+}
+);
+</script>
my $f1 = $self->get_client_group_filter();
my $f2 = $self->get_client_filter();
+# client_group_name | here
+#-------------------+-----
+# GROUP1 | 1
+# GRP3 | 0
+
my $query = "
-SELECT client_group_name, here
- FROM client_group $f1
- LEFT JOIN (SELECT 1 AS here, client_group_id
- FROM Client JOIN client_group_member USING (ClientId) $f2
- WHERE Name = $arg->{qclient}) AS temp USING (client_group_id)
-";
+SELECT client_group_name, max(here) AS here FROM (
+ SELECT client_group_name, 1 AS here
+ FROM client_group
+ JOIN client_group_member USING (client_group_id)
+ JOIN Client USING (ClientId) $f2
+ WHERE Name = $arg->{qclient}
+ UNION ALL
+ SELECT client_group_name, 0
+ FROM client_group $f1
+) AS temp
+GROUP by client_group_name";
my $all = $self->dbh_selectall_hashref($query, 'client_group_name');
# rolename | userid
#------------+--------
-# cancel_job |
-# restore |
+# cancel_job | 0
+# restore | 0
# run_job | 1
my $role = $self->dbh_selectall_hashref("
-SELECT rolename, temp.userid
- FROM bweb_role
- LEFT JOIN (SELECT roleid, userid
- FROM bweb_user JOIN bweb_role_member USING (userid)
- WHERE username = $user) AS temp USING (roleid)
-ORDER BY rolename
-", 'rolename');
+SELECT rolename, max(here) AS userid FROM (
+ SELECT rolename, 1 AS here
+ FROM bweb_user
+ JOIN bweb_role_member USING (userid)
+ JOIN bweb_role USING (roleid)
+ WHERE username = $user
+ UNION ALL
+ SELECT rolename, 0
+ FROM bweb_role
+) AS temp
+GROUP by rolename", 'rolename');
$arg = $self->get_form(qw/db_usernames db_client_groups/);
+14Feb08
+ebl Cleanup some SQL
+
13Feb08
ebl Can modify client list group for a specific client
ebl Disable use of Enabled flag in volume mgnt
--- /dev/null
+<br/>
+ <div class='titlediv'>
+ <h1 class='newstitle'>Client <TMPL_VAR Name></h1>
+ </div>
+ <div class='bodydiv'>
+<form name="client" action='?' method='GET'>
+ <input type='hidden' name='client' value=<TMPL_VAR qclient>>
+ <table id='id<TMPL_VAR ID>'></table>
+ <div class="otherboxtitle">
+ Actions
+ </div>
+ <div class="otherbox">
+ <button type="submit" class="bp" name='action' value='client_save' title="__Apply__"> <img src='/bweb/apply.png' alt=''>__Apply__</button>
+ </div>
+
+</form>
+ </div>
+
+<script type="text/javascript" language="JavaScript">
+var header = new Array("__Group Name__", "__Description__", "__Selection__");
+
+var data = new Array();
+var radiobox ;
+
+<TMPL_LOOP client_group>
+radiobox = document.createElement('INPUT');
+radiobox.type = 'radio';
+radiobox.name = 'client_group';
+radiobox.value = '<TMPL_VAR client_group_name>';
+radiobox.checked = <TMPL_IF here>1<TMPL_ELSE>0</TMPL_IF>;
+
+data.push(
+ new Array( "<TMPL_VAR client_group_name>",
+ "<TMPL_VAR comment>",
+ radiobox
+ )
+) ;
+</TMPL_LOOP>
+
+nrsTable.setup(
+{
+ table_name: "id<TMPL_VAR ID>",
+ table_header: header,
+ table_data: data,
+ up_icon: up_icon,
+ down_icon: down_icon,
+ prev_icon: prev_icon,
+ next_icon: next_icon,
+ rew_icon: rew_icon,
+ fwd_icon: fwd_icon,
+// natural_compare: false,
+ even_cell_color: even_cell_color,
+ odd_cell_color: odd_cell_color,
+ header_color: header_color,
+ page_nav: true,
+ rows_per_page: rows_per_page,
+ disable_sorting: new Array(1)
+}
+);
+</script>