コード例 #1
0
/**
 * Job 1
 */
function oqc_sendReminders()
{
    $GLOBALS['log']->error('----->Scheduler fired job of type oqc_sendReminders<-----');
    //global $dictionary;
    //global $app_strings;
    require_once 'modules/oqc_Task/oqc_Task.php';
    $task = new oqc_Task();
    $overdueTasks = $task->getOverdueTasks();
    foreach ($overdueTasks as $dueTaskId) {
        $dueTask = new oqc_Task();
        $lazyUsers = array();
        if ($dueTask->retrieve($dueTaskId)) {
            $lazyUsers = $dueTask->getLazyUsers();
            if (!empty($lazyUsers)) {
                $dueTask->sendNotifications($lazyUsers, 'overdue');
            } else {
                $dueTask->sendNotifications(array($dueTask->assigned_user_id), 'overdue');
            }
        }
    }
    return true;
}
コード例 #2
0
 function task_retrieve($task_id, $view, $parent_module = null, $parent_id)
 {
     global $current_user;
     $is_done = false;
     $task = new oqc_Task();
     //This might be not required, since if we are at this point, the task could not be unset
     if (!empty($task_id) && $task->retrieve($task_id)) {
         $user_beans = $this->get_oqc_task_users($task_id);
         $is_done = $task->isdone ? true : false;
     } else {
         $user_beans = $this->get_oqc_task_default_users($parent_module, $parent_id);
     }
     $user_array = array();
     if (!empty($user_beans)) {
         foreach ($user_beans as $user) {
             //Here we assemble all user information into array for later transfer to browser
             $user_data = array();
             $user_data = array('User_id' => $user->id, 'Name' => $user->first_name . ' ' . $user->last_name, 'Progress' => $user->progress, 'Accepted' => $user->accept_status, 'Resolution' => $user->resolution, 'Description' => from_html($user->comment), 'Position' => $user->position, 'DateModified' => $user->oqc_task_date_modified, 'isEdtRow' => $user->id == $current_user->id && $view == 'EditView' && !$is_done ? true : false, 'Attachments' => array());
             $attachments = $this->get_oqc_task_attachments($user->attachmentsequence);
             if (!empty($attachments)) {
                 foreach ($attachments as $attachment) {
                     $rev_number = $attachment->revision ? '_rev.' . $attachment->revision : '';
                     $rev_id = $attachment->doc_rev_id ? $attachment->doc_rev_id : $attachment->document_revision_id;
                     $attachment_data = array();
                     $attachment_data["id"] = $attachment->id;
                     $attachment_data["document_name"] = from_html($attachment->document_name) . $rev_number;
                     $attachment_data["document_revision_id"] = $rev_id;
                     $attachment_data["doc_status"] = 'saved';
                     $user_data['Attachments'][] = $attachment_data;
                 }
             }
             $user_array[] = $user_data;
         }
     }
     return $user_array;
 }
コード例 #3
0
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
/*********************************************************************************
 * Description:  TODO: To be written.
 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
 * All Rights Reserved.
 * Contributor(s): ______________________________________..
 ********************************************************************************/
require_once 'modules/oqc_Task/oqc_Task.php';
require_once 'modules/Users/User.php';
if (!isset($_POST["user_status"])) {
    return;
}
$task = new oqc_Task();
for ($i = 0; $i < count($_POST["user_status"]); $i++) {
    $user_data = array();
    if ($_POST["user_status"][$i] == 'delete') {
        $user_data = explode(':', $_POST['users_ids'][$i]);
        $module_name = $user_data[0];
        $user_id = $user_data[1];
        $user = new User();
        if ($user->retrieve($user_id)) {
            $task->deleteDefaultUser($user_id);
        } else {
            $GLOBALS['log']->error("This is not a valid user id: {$user_id}");
        }
    } elseif ($_POST["user_status"][$i] == 'new') {
        $user_data = explode(':', $_POST['users_ids'][$i]);
        $module_name = $user_data[0];
コード例 #4
0
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
require_once 'modules/oqc_Task/oqc_Task.php';
global $current_user;
if ($_REQUEST['object_type'] == "oqc_Task") {
    $focus = new oqc_Task();
    $focus->id = $_REQUEST['object_id'];
    $test = $focus->set_accept_status($current_user, $_REQUEST['accept_status']);
}
print 1;
exit;
コード例 #5
0
if (isset($mod_strings['LBL_MODULE_ID'])) {
    $mod_id = $mod_strings['LBL_MODULE_ID'];
}
if (isset($mod_strings['LBL_MODULE_NAME'])) {
    $mod_name = $mod_strings['LBL_MODULE_NAME'];
}
echo "\n<p>\n";
echo get_module_title($mod_id, $mod_name . ": " . $mod_strings['LBL_TASK_CONFIGURE'], true);
echo "\n</p>\n";
$json = getJSONobj();
$smarty = new Sugar_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$languageStrings = array("delete" => $mod_strings["LBL_DELETE_HEADER"], "addUser" => $mod_strings["LBL_ADD_USER"]);
$languageStringsJSON = $json->encode($languageStrings);
$task = new oqc_Task();
$modules_list = $app_list_strings["oqc_parent_type_display_list"];
$defaultUsersBeans = $task->getDefaultUsers();
$module_array = $task->fill_defaultUsersArray($defaultUsersBeans, $modules_list);
$modules_dropdown = $app_list_strings["oqc_parent_type_display_list"];
$modules_dropdownJSON = $json->encode($app_list_strings["oqc_parent_type_display_list"]);
//$GLOBALS['log']->error("Module Array: ". var_export($module_array, true));
$smarty->assign('moduleArray', $module_array);
// setup the popup link
$user_popup_request_data = array('call_back_function' => 'popup_return_user', 'formName' => 'EditView', 'field_to_name_array' => array("id" => "user_id", "user_name" => "user_name", "name" => "name"), 'passthru_data' => array());
$encoded_request_data = $json->encode($user_popup_request_data);
$modules_dropdownJSON = $json->encode($app_list_strings["oqc_parent_type_display_list"]);
$smarty->assign('modulesDropdown', $modules_dropdownJSON);
$smarty->assign('languageStrings', $languageStringsJSON);
$smarty->assign('initialFilter', "\"&status=Active\"");
$smarty->assign('users_popup_encoded_request_data', $encoded_request_data);