PluginProbe
ShiftController Employee Shift Scheduling / 2.2.3
ShiftController Employee Shift Scheduling v2.2.3
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
← All changes | application/modules/wordpress/views/admin/users/sync.php +99 -118 3.2.42.2.3 View file →
@@ -1,130 +1,111 @@
1 1 <?php
2 -$this->layout->set_partial(
3 - 'header',
4 - HC_Html::page_header(
5 - HC_Html_Factory::element('h2')
6 - ->add_child( $app_title . ': Installation' )
7 - ->add_child( '<br>' )
8 - ->add_child(
9 - HC_Html_Factory::element('small')
10 - ->add_child( HCM::__('Import User Accounts') )
11 - )
12 - )
13 - );
14 -
15 -$out = HC_Html_Factory::widget('list')
16 - ->add_style('margin', 'b1')
17 - ->add_children_style('margin', 'b1')
18 - ;
19 -
20 -if( isset($offer_upgrade) && $offer_upgrade ){
21 - $link = HC_Lib::link('setup/upgrade');
22 - $out->add_child(
23 - HC_Html_Factory::element('a')
24 - ->add_attr('href', $link->url())
25 - ->add_child('You seem to have an older version already installed. Click here to upgrade.')
26 - );
27 - $out->add_child(
28 - 'continue',
29 - 'Or continue below to install from scratch.'
30 - );
31 - $out->add_child_attr(
32 - 'continue',
33 - 'style', 'margin-bottom: 1em;'
34 - );
35 -}
36 -
37 -$help = HC_Html_Factory::element('div')
38 - ->add_style('box')
39 - ->add_style('border-color', 'olive')
40 - ;
41 -$help->add_child(
42 - 'You need to run this action only if you want to change WordPress Role to ' . $app_title . ' User Level relation configuration. ' .
43 - 'Normally user accounts in ' . $app_title . ' are automatically syncronized with WordPress as soon as they get added, updated or deleted in WordPress.'
44 - );
45 -if( ! $is_setup ){
46 - $out->add_child( $help );
47 -}
48 -
49 -$link = HC_Lib::link($post_to);
50 -
51 -$display_form = HC_Html_Factory::widget('form')
52 - ->add_attr('action', $link->url() )
53 - ;
54 -
55 -$table = HC_Html_Factory::widget('table')
56 - ->add_style('table', 'border')
57 - ;
58 -$table->set_header(
2 +$CI =& ci_get_instance();
3 +$app_title = $CI->config->item('nts_app_title');
4 +?>
5 +<?php
6 +echo form_open(
7 + 'wordpress/admin/users/syncrun',
59 8 array(
60 - 'WordPress',
61 - $app_title
9 + 'class' => 'form-horizontal form-condensed'
62 10 )
63 11 );
12 +?>
64 13
65 -foreach( $wordpress_roles as $role_value => $role_name ){
66 - $this_role_count = ( isset($wordpress_count_users['avail_roles'][$role_value]) ) ? $wordpress_count_users['avail_roles'][$role_value] : 0;
67 - $row = array();
68 - $row[] = $role_name . ' [' . $this_role_count . ']';
14 +<fieldset>
15 + <legend>Copy User Accounts</legend>
69 16
70 - if( $role_value ){
71 - if( $role_value == 'administrator' ){
72 - $default = USER_HC_MODEL::LEVEL_ADMIN;
73 - }
74 - else {
75 - if( $this_role_count )
76 - $default = USER_HC_MODEL::LEVEL_STAFF;
77 - else
78 - $default = 0;
79 - }
80 - }
81 - else {
82 - $default = 0;
83 - }
17 + <table class="table table-striped table-condensed">
18 + <tr>
19 + <th>
20 +
21 + </th>
22 + <th>
23 + <?php echo $app_title; ?>
24 + </th>
25 + </tr>
84 26
85 - $field_name = 'role_' . $role_value;
86 - $options = array(
87 - USER_HC_MODEL::LEVEL_ADMIN => HCM::__('Admin'),
88 - USER_HC_MODEL::LEVEL_MANAGER => HCM::__('Manager'),
89 - USER_HC_MODEL::LEVEL_STAFF => HCM::__('Staff'),
90 - 0 => HCM::__('Do Not Import'),
91 - );
27 + <?php foreach( $wordpress_roles as $role_value => $role_name ) : ?>
28 + <?php
29 + $this_role_count = ( isset($wordpress_count_users['avail_roles'][$role_value]) ) ? $wordpress_count_users['avail_roles'][$role_value] : 0;
30 + ?>
31 + <tr class="<?php echo $this_role_count ? 'success' : ''; ?>">
32 + <td>
33 + <?php echo $role_name; ?> [<?php echo $this_role_count; ?>]
34 + </td>
35 + <td>
36 + <?php
37 + if( $role_value )
38 + {
39 + if( $role_value == 'administrator' )
40 + {
41 + $default = USER_MODEL::LEVEL_ADMIN;
42 + }
43 + else
44 + {
45 + if( $this_role_count )
46 + $default = USER_MODEL::LEVEL_STAFF;
47 + else
48 + $default = 0;
49 + }
50 + }
51 + else
52 + $default = 0;
92 53
93 - $row[] = $form->input($field_name)
94 - ->set_options($options)
95 - ->set_default($default)
96 - ;
97 - $table->add_row($row);
98 -}
54 + $field_name = 'role_' . $role_value;
55 + $options = array(
56 + USER_MODEL::LEVEL_ADMIN => lang('user_level_admin'),
57 + USER_MODEL::LEVEL_MANAGER => lang('user_level_manager'),
58 + USER_MODEL::LEVEL_STAFF => lang('user_level_staff'),
59 + 0 => lang('common_none'),
60 + );
99 61
100 -/*
101 -$row = array();
102 -$row[] = '';
103 -$row[] = $form->input('append_role_name') . 'Append Original Role Name To Staff Name (Like "Subscriber John Doe")';
104 -$table->add_row($row);
105 -*/
62 + echo $this->hc_form->input(
63 + array(
64 + 'type' => 'dropdown',
65 + 'name' => $field_name,
66 + 'options' => $options,
67 + 'default' => $default,
68 + )
69 + );
70 + ?>
71 + </td>
72 + </tr>
73 + <?php endforeach; ?>
106 74
107 -$buttons = HC_Html_Factory::widget('list')
108 - ->add_children_style('inline')
109 - ->add_children_style('margin', 'r1')
110 - ;
75 + <tr>
76 + <td>
77 + &nbsp;
78 + </td>
79 + <td>
80 + <?php
81 + echo $this->hc_form->input(
82 + array(
83 + 'type' => 'checkbox',
84 + 'name' => 'append_role_name',
85 + )
86 + );
87 + ?> Append Original Role Name To Staff Name
88 + </td>
89 + </tr>
111 90
112 -$btn_label = $is_setup ? HCM::__('Import User Accounts') : HCM::__('Sync Users');
113 -$buttons->add_child(
114 - HC_Html_Factory::element('input')
115 - ->add_attr('type', 'submit')
116 - ->add_attr('title', $btn_label )
117 - ->add_attr('value', $btn_label )
118 - ->add_style('btn-primary')
119 - );
91 + <tr>
92 + <td>
93 + &nbsp;
94 + </td>
95 + <td>
96 + <?php
97 + echo form_button(
98 + array(
99 + 'type' => 'submit',
100 + 'name' => 'submit',
101 + 'class' => 'btn btn-primary'
102 + ),
103 + lang('common_go')
104 + );
105 + ?>
106 + </td>
107 + </tr>
108 + </table>
109 +</fieldset>
120 110
121 -$row = array();
122 -$row[] = '';
123 -$row[] = $buttons;
124 -$table->add_row($row);
125 -
126 -$display_form->add_child( $table );
127 -
128 -$out->add_child( $display_form );
129 -echo $out->render();
130 -?>
111 +<?php echo form_close();?>