</tbody> </table> </div> <?php $fieldset_data['elements_before'] = ob_get_clean(); } echo module_form::generate_fieldset($fieldset_data); } } // show the jobs linked to this website. if (module_job::is_plugin_enabled() && module_job::can_i('view', 'Jobs')) { $jobs = module_job::get_jobs(array('website_id' => $website_id)); if (count($jobs) || module_job::can_i('create', 'Jobs')) { $h = array('type' => 'h3', 'title' => module_config::c('project_name_single', 'Website') . ' Jobs'); if (module_job::can_i('create', 'Jobs')) { $h['button'] = array('title' => 'New Job', 'url' => module_job::link_generate('new', array('arguments' => array('website_id' => $website_id)))); } $fieldset_data = array('heading' => $h); if (count($jobs)) { $c = 0; ob_start(); ?> <div class="content_box_wheader"> <table border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows tableclass_full"> <thead> <tr> <th> <?php _e('Job Title');
if ((int) $job_id > 0 && module_job::can_i('edit', 'Jobs')) { $fieldset_data['elements'][] = array('title' => 'Email Job', 'field' => array('type' => 'html', 'value' => '<a href="' . module_job::link_generate($job_id, array('arguments' => array('email' => 1))) . '">' . _l('Email this Job to Customer') . '</a>', 'help' => 'You can email the customer a copy of this job. This can be a progress report or as an initial quote. ')); $fieldset_data['elements'][] = array('title' => 'Email Staff', 'fields' => array(function () use(&$job_tasks, $job_id) { $allocated_staff_members = array(); foreach ($job_tasks as $job_task) { if (!isset($allocated_staff_members[$job_task['user_id']])) { $allocated_staff_members[$job_task['user_id']] = 0; } $allocated_staff_members[$job_task['user_id']]++; } foreach ($allocated_staff_members as $staff_id => $count) { $staff = module_user::get_user($staff_id); ?> <a href="<?php echo module_job::link_generate($job_id, array('arguments' => array('email_staff' => 1, 'staff_id' => $staff_id))); ?> "><?php _e('Email staff (%s - %s tasks)', $staff['name'], $count); ?> </a> <br/> <?php } })); } if (class_exists('module_website', false) && module_website::is_plugin_enabled()) { $fieldset_data['elements'][] = array('title' => module_config::c('project_name_single', 'Website'), 'fields' => array(function () use(&$job) { if (module_job::can_i('edit', 'Jobs')) { $c = array(); // change between websites within this customer? // or websites all together?