Merge branch 'master' of bitbucket.org:colosa/processmaker
This commit is contained in:
@@ -200,6 +200,8 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
'APP_UID' => '',
|
||||
'SHD_DATE' => date('Y-m-d H:i:s')));
|
||||
*/
|
||||
|
||||
G::auditLog("CreatePmtable", "PM Table Name: ".$aData['ADD_TAB_NAME']);
|
||||
return $aData['ADD_TAB_UID'];
|
||||
} else {
|
||||
$sMessage = '';
|
||||
@@ -226,6 +228,7 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
$oConnection->begin();
|
||||
$iResult = $oAdditionalTables->save();
|
||||
$oConnection->commit();
|
||||
G::auditLog("UpdatePmtable", "PM Table Name: ".$aData['ADD_TAB_NAME']." PM Table ID: (".$aData['ADD_TAB_UID'].") ");
|
||||
} else {
|
||||
$sMessage = '';
|
||||
$aValidationFailures = $oAdditionalTables->getValidationFailures();
|
||||
|
||||
@@ -64,7 +64,115 @@ class AddonsStore extends BaseAddonsStore
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function addonList()
|
||||
public static function addonList($type = 'plugin')
|
||||
{
|
||||
$result = array();
|
||||
|
||||
AddonsStore::checkLicenseStore();
|
||||
|
||||
$licenseManager = &pmLicenseManager::getSingleton(); //Getting the licenseManager
|
||||
|
||||
$result["store_errors"] = array();
|
||||
list($stores, $errors) = AddonsStore::updateAll(false, $type);
|
||||
|
||||
foreach ($errors as $store_id => $store_error) {
|
||||
$result["store_errors"][] = array("id" => $store_id, "msg" => $store_error);
|
||||
}
|
||||
|
||||
$result["addons"] = array();
|
||||
$result["errors"] = array();
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addAscendingOrderByColumn(AddonsManagerPeer::ADDON_TYPE);
|
||||
$criteria->addAscendingOrderByColumn(AddonsManagerPeer::ADDON_ID);
|
||||
$criteria->add(AddonsManagerPeer::ADDON_TYPE, $type, Criteria::EQUAL);
|
||||
$addons = AddonsManagerPeer::doSelect($criteria);
|
||||
|
||||
foreach ($addons as $addon) {
|
||||
|
||||
$status = $addon->getAddonStatus();
|
||||
$version = $addon->getAddonVersion();
|
||||
$enabled = null;
|
||||
|
||||
if (!$addon->checkState()) {
|
||||
$result["errors"][] = array("addonId" => $addon->getAddonId(), "storeId" => $addon->getStoreId());
|
||||
}
|
||||
|
||||
$sw = 1;
|
||||
$addonInLicense = in_array($addon->getAddonId(), $licenseManager->features);
|
||||
|
||||
if ($sw == 1 && $addon->getAddonId() != "enterprise" && !$addonInLicense) {
|
||||
$sw = 0;
|
||||
}
|
||||
|
||||
if ($type == 'plugin') {
|
||||
if ($sw == 1 && $addon->isInstalled()) {
|
||||
if ($addon->isEnabled()) {
|
||||
$status = "installed";
|
||||
} else {
|
||||
$status = "disabled";
|
||||
}
|
||||
|
||||
$version = $addon->getInstalledVersion();
|
||||
|
||||
if (version_compare($version . "", $addon->getAddonVersion() . "", "<")) {
|
||||
$status = "upgrade";
|
||||
}
|
||||
|
||||
$enabled = $addon->isEnabled();
|
||||
$sw = 0;
|
||||
}
|
||||
} else {
|
||||
$status = "available";
|
||||
$enabled = false;
|
||||
if (!$addonInLicense && in_array($addon->getAddonName(), $licenseManager->licensedfeatures) == 1) {
|
||||
$status = "installed";
|
||||
$enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($sw == 1 && $addonInLicense) {
|
||||
$status = "ready";
|
||||
$sw = 0;
|
||||
}
|
||||
|
||||
$state = $addon->getAddonState();
|
||||
$log = null;
|
||||
|
||||
if ($state != null) {
|
||||
$status = $state;
|
||||
$log = $addon->getInstallLog();
|
||||
}
|
||||
if ($addon->getAddonId() == "enterprise" && $status== 'ready') {
|
||||
$status = 'installed';
|
||||
}
|
||||
if ($status == 'minus-circle' ) {
|
||||
$status = "available";
|
||||
}
|
||||
|
||||
$result["addons"][$addon->getAddonId()] = array(
|
||||
"id" => $addon->getAddonId(),
|
||||
"store" => $addon->getStoreId(),
|
||||
"name" => $addon->getAddonName(),
|
||||
"nick" => $addon->getAddonNick(),
|
||||
"version" => $version,
|
||||
"enabled" => $enabled,
|
||||
"latest_version" => $addon->getAddonVersion(),
|
||||
"type" => $addon->getAddonType(),
|
||||
"release_type" => $addon->getAddonReleaseType(),
|
||||
"url" => $addon->getAddonDownloadUrl(),
|
||||
"publisher" => $addon->getAddonPublisher(),
|
||||
"description" => $addon->getAddonDescription(),
|
||||
"status" => $status,
|
||||
"log" => $log,
|
||||
"progress" => round($addon->getAddonDownloadProgress())
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function addonFeatureList()
|
||||
{
|
||||
$result = array();
|
||||
|
||||
@@ -135,6 +243,9 @@ class AddonsStore extends BaseAddonsStore
|
||||
if ($addon->getAddonId() == "enterprise" && $status== 'ready') {
|
||||
$status = 'installed';
|
||||
}
|
||||
if ($status == 'minus-circle' ) {
|
||||
$status = "available";
|
||||
}
|
||||
|
||||
$result["addons"][$addon->getAddonId()] = array(
|
||||
"id" => $addon->getAddonId(),
|
||||
@@ -175,14 +286,14 @@ class AddonsStore extends BaseAddonsStore
|
||||
*
|
||||
* @return array containing a 'stores' array and a 'errors' array
|
||||
*/
|
||||
public static function updateAll($force = false)
|
||||
public static function updateAll($force = false, $type = 'plugin')
|
||||
{
|
||||
$stores = array();
|
||||
$errors = array();
|
||||
|
||||
foreach (self::listStores() as $store) {
|
||||
try {
|
||||
$stores[$store->getStoreId()] = $store->update($force);
|
||||
$stores[$store->getStoreId()] = $store->update($force, $type);
|
||||
} catch (Exception $e) {
|
||||
$errors[$store->getStoreId()] = $e->getMessage();
|
||||
}
|
||||
@@ -196,11 +307,12 @@ class AddonsStore extends BaseAddonsStore
|
||||
*
|
||||
* @return int number of addons removed
|
||||
*/
|
||||
public function clear()
|
||||
public function clear($type = 'plugin')
|
||||
{
|
||||
/* Remove old items from this store */
|
||||
$criteria = new Criteria(AddonsManagerPeer::DATABASE_NAME);
|
||||
$criteria->add(AddonsManagerPeer::STORE_ID, $this->getStoreId(), Criteria::EQUAL);
|
||||
$criteria->add(AddonsManagerPeer::ADDON_TYPE, $type, Criteria::EQUAL);
|
||||
|
||||
return AddonsManagerPeer::doDelete($criteria);
|
||||
}
|
||||
@@ -210,7 +322,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
*
|
||||
* @return bool true if updated, false otherwise
|
||||
*/
|
||||
public function update($force = false)
|
||||
public function update($force = false, $type = 'plugin')
|
||||
{
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'class.pmLicenseManager.php';
|
||||
|
||||
@@ -221,12 +333,13 @@ class AddonsStore extends BaseAddonsStore
|
||||
//If we have any addon that is installing or updating, don't update store
|
||||
$criteria = new Criteria(AddonsManagerPeer::DATABASE_NAME);
|
||||
$criteria->add(AddonsManagerPeer::ADDON_STATE, '', Criteria::NOT_EQUAL);
|
||||
$criteria->add(AddonsManagerPeer::ADDON_TYPE, $type);
|
||||
|
||||
if (AddonsManagerPeer::doCount($criteria) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->clear();
|
||||
$this->clear($type);
|
||||
|
||||
//Fill with local information
|
||||
|
||||
@@ -241,74 +354,98 @@ class AddonsStore extends BaseAddonsStore
|
||||
$pmLicenseManagerO = &pmLicenseManager::getSingleton();
|
||||
$localPlugins = array();
|
||||
|
||||
foreach ($aPluginsPP as $aPlugin) {
|
||||
$sClassName = substr($aPlugin['sFilename'], 0, strpos($aPlugin['sFilename'], '-'));
|
||||
if ($type == 'plugin') {
|
||||
foreach ($aPluginsPP as $aPlugin) {
|
||||
$sClassName = substr($aPlugin['sFilename'], 0, strpos($aPlugin['sFilename'], '-'));
|
||||
|
||||
if (file_exists(PATH_PLUGINS . $sClassName . '.php')) {
|
||||
require_once PATH_PLUGINS . $sClassName . '.php';
|
||||
if (file_exists(PATH_PLUGINS . $sClassName . '.php')) {
|
||||
require_once PATH_PLUGINS . $sClassName . '.php';
|
||||
|
||||
$oDetails = $oPluginRegistry->getPluginDetails($sClassName . '.php');
|
||||
$oDetails = $oPluginRegistry->getPluginDetails($sClassName . '.php');
|
||||
|
||||
if ($oDetails) {
|
||||
$sStatus = $oDetails->enabled ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED');
|
||||
if ($oDetails) {
|
||||
$sStatus = $oDetails->enabled ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED');
|
||||
|
||||
if (isset($oDetails->aWorkspaces)) {
|
||||
if (!in_array(SYS_SYS, $oDetails->aWorkspaces)) {
|
||||
if (isset($oDetails->aWorkspaces)) {
|
||||
if (!in_array(SYS_SYS, $oDetails->aWorkspaces)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($sClassName == "pmLicenseManager" || $sClassName == "pmTrial") {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sEdit = (($oDetails->sSetupPage != '') && ($oDetails->enabled)? G::LoadTranslation('ID_SETUP') : ' ');
|
||||
$aPlugin = array();
|
||||
$aPluginId = $sClassName;
|
||||
$aPluginTitle = $oDetails->sFriendlyName;
|
||||
$aPluginDescription = $oDetails->sDescription;
|
||||
$aPluginVersion = $oDetails->iVersion;
|
||||
|
||||
if (@in_array($sClassName, $pmLicenseManagerO->features)) {
|
||||
$aPluginStatus = $sStatus;
|
||||
$aPluginLinkStatus = 'pluginsChange?id=' . $sClassName . '.php&status=' . $oDetails->enabled;
|
||||
$aPluginEdit = $sEdit;
|
||||
$aPluginLinkEdit = 'pluginsSetup?id=' . $sClassName . '.php';
|
||||
$aPluginStatusA = $sStatus == "Enabled" ? "installed" : 'disabled';
|
||||
$enabledStatus = true;
|
||||
} else {
|
||||
$aPluginStatus = "";
|
||||
$aPluginLinkStatus = '';
|
||||
$aPluginEdit = '';
|
||||
$aPluginLinkEdit = '';
|
||||
$aPluginStatusA = 'minus-circle';
|
||||
$enabledStatus = false;
|
||||
}
|
||||
|
||||
$addon = new AddonsManager();
|
||||
//G::pr($addon);
|
||||
$addon->setAddonId($aPluginId);
|
||||
$addon->setStoreId($this->getStoreId());
|
||||
//Don't trust external data
|
||||
$addon->setAddonName($aPluginId);
|
||||
$addon->setAddonDescription($aPluginDescription);
|
||||
$addon->setAddonNick($aPluginTitle);
|
||||
$addon->setAddonVersion("");
|
||||
$addon->setAddonStatus($aPluginStatusA);
|
||||
$addon->setAddonType("plugin");
|
||||
$addon->setAddonPublisher("Colosa");
|
||||
$addon->setAddonDownloadUrl("");
|
||||
$addon->setAddonDownloadMd5("");
|
||||
$addon->setAddonReleaseDate(null);
|
||||
$addon->setAddonReleaseType('localRegistry');
|
||||
$addon->setAddonReleaseNotes("");
|
||||
$addon->setAddonState("");
|
||||
|
||||
$addon->save();
|
||||
|
||||
$localPlugins[$aPluginId] = $addon;
|
||||
}
|
||||
|
||||
if ($sClassName == "pmLicenseManager" || $sClassName == "pmTrial") {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sEdit = (($oDetails->sSetupPage != '') && ($oDetails->enabled)? G::LoadTranslation('ID_SETUP') : ' ');
|
||||
$aPlugin = array();
|
||||
$aPluginId = $sClassName;
|
||||
$aPluginTitle = $oDetails->sFriendlyName;
|
||||
$aPluginDescription = $oDetails->sDescription;
|
||||
$aPluginVersion = $oDetails->iVersion;
|
||||
|
||||
if (@in_array($sClassName, $pmLicenseManagerO->features)) {
|
||||
$aPluginStatus = $sStatus;
|
||||
$aPluginLinkStatus = 'pluginsChange?id=' . $sClassName . '.php&status=' . $oDetails->enabled;
|
||||
$aPluginEdit = $sEdit;
|
||||
$aPluginLinkEdit = 'pluginsSetup?id=' . $sClassName . '.php';
|
||||
$aPluginStatusA = $sStatus == "Enabled" ? "installed" : 'disabled';
|
||||
$enabledStatus = true;
|
||||
} else {
|
||||
$aPluginStatus = "";
|
||||
$aPluginLinkStatus = '';
|
||||
$aPluginEdit = '';
|
||||
$aPluginLinkEdit = '';
|
||||
$aPluginStatusA = 'minus-circle';
|
||||
$enabledStatus = false;
|
||||
}
|
||||
|
||||
$addon = new AddonsManager();
|
||||
//G::pr($addon);
|
||||
$addon->setAddonId($aPluginId);
|
||||
$addon->setStoreId($this->getStoreId());
|
||||
//Don't trust external data
|
||||
$addon->setAddonName($aPluginId);
|
||||
$addon->setAddonDescription($aPluginDescription);
|
||||
$addon->setAddonNick($aPluginTitle);
|
||||
$addon->setAddonVersion("");
|
||||
$addon->setAddonStatus($aPluginStatusA);
|
||||
$addon->setAddonType("plugin");
|
||||
$addon->setAddonPublisher("Colosa");
|
||||
$addon->setAddonDownloadUrl("");
|
||||
$addon->setAddonDownloadMd5("");
|
||||
$addon->setAddonReleaseDate(null);
|
||||
$addon->setAddonReleaseType('localRegistry');
|
||||
$addon->setAddonReleaseNotes("");
|
||||
$addon->setAddonState("");
|
||||
|
||||
$addon->save();
|
||||
|
||||
$localPlugins[$aPluginId] = $addon;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$list = unserialize($pmLicenseManagerO->licensedfeaturesList);
|
||||
foreach ($list['addons'] as $key => $feature) {
|
||||
$addon = new AddonsManager();
|
||||
$addon->setAddonId($feature['name']);
|
||||
$addon->setStoreId($feature['guid']);
|
||||
$addon->setAddonName($feature['name']);
|
||||
$addon->setAddonDescription($feature['description']);
|
||||
$addon->setAddonNick($feature['nick']);
|
||||
$addon->setAddonVersion("");
|
||||
$addon->setAddonStatus($feature['status']);
|
||||
$addon->setAddonType("features");
|
||||
$addon->setAddonPublisher("Colosa");
|
||||
$addon->setAddonDownloadUrl("");
|
||||
$addon->setAddonDownloadMd5("");
|
||||
$addon->setAddonReleaseDate(null);
|
||||
$addon->setAddonReleaseType('localRegistry');
|
||||
$addon->setAddonReleaseNotes("");
|
||||
$addon->setAddonState("");
|
||||
|
||||
$addon->save();
|
||||
}
|
||||
}
|
||||
|
||||
$this->setStoreLastUpdated(time());
|
||||
@@ -359,6 +496,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
$context = stream_context_create($option);
|
||||
|
||||
//This may block for a while, always use AJAX to call this method
|
||||
$url = $url . '&type=' . strtoupper($type);
|
||||
$data = file_get_contents($url, false, $context);
|
||||
|
||||
if ($data === false) {
|
||||
@@ -388,7 +526,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
throw (new Exception("Addons not found on store data"));
|
||||
}
|
||||
|
||||
$this->clear();
|
||||
$this->clear($type);
|
||||
|
||||
try {
|
||||
//Add each item to this stores addons
|
||||
@@ -451,7 +589,7 @@ class AddonsStore extends BaseAddonsStore
|
||||
$this->save();
|
||||
} catch (Exception $e) {
|
||||
//If we had issues, don't keep only a part of the items
|
||||
$this->clear();
|
||||
$this->clear($type);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
@@ -253,7 +253,11 @@ class CalendarDefinition extends BaseCalendarDefinition
|
||||
if (! (is_object( $tr ) && get_class( $tr ) == 'CalendarDefinition')) {
|
||||
$tr = new CalendarDefinition();
|
||||
$tr->setCalendarCreateDate( 'now' );
|
||||
G::auditLog("CreateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']);
|
||||
} else {
|
||||
G::auditLog("UpdateCalendar", "Calendar Name: ".$aData['CALENDAR_NAME']." Calendar ID: (".$CalendarUid.") ");
|
||||
}
|
||||
|
||||
$tr->setCalendarUid( $CalendarUid );
|
||||
$tr->setCalendarName( $CalendarName );
|
||||
$tr->setCalendarUpdateDate( 'now' );
|
||||
@@ -315,6 +319,8 @@ class CalendarDefinition extends BaseCalendarDefinition
|
||||
if ($tr->validate()) {
|
||||
// we save it, since we get no validation errors, or do whatever else you like.
|
||||
$res = $tr->save();
|
||||
$deletedCalendar = $tr->getCalendarName();
|
||||
G::auditLog("DeleteCalendar", "Calendar Name: ".$deletedCalendar." Calendar ID: (".$CalendarUid.") ");
|
||||
} else {
|
||||
// Something went wrong. We can now get the validationFailures and handle them.
|
||||
$msg = '';
|
||||
|
||||
@@ -342,7 +342,7 @@ class Content extends BaseContent
|
||||
`CON_LANG` VARCHAR(10) default '' NOT NULL,
|
||||
`CON_VALUE` MEDIUMTEXT NOT NULL,
|
||||
CONSTRAINT CONTENT_BACKUP_PK PRIMARY KEY (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG)
|
||||
)Engine=MyISAM DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
|
||||
)Engine=InnoDB DEFAULT CHARSET='utf8' COMMENT='Table for add content';" );
|
||||
$oStatement->executeQuery();
|
||||
|
||||
$sql = " SELECT DISTINCT CON_LANG
|
||||
|
||||
@@ -57,8 +57,10 @@ class DashletInstance extends BaseDashletInstance
|
||||
$data['DAS_INS_UID'] = G::generateUniqueID();
|
||||
$data['DAS_INS_CREATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance = new DashletInstance();
|
||||
$msg = 'CreateDashletInstance';
|
||||
} else {
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($data['DAS_INS_UID']);
|
||||
$msg = 'UpdateDashletInstance';
|
||||
}
|
||||
$data['DAS_INS_UPDATE_DATE'] = date('Y-m-d H:i:s');
|
||||
$dashletInstance->fromArray($data, BasePeer::TYPE_FIELDNAME);
|
||||
@@ -66,6 +68,10 @@ class DashletInstance extends BaseDashletInstance
|
||||
$connection->begin();
|
||||
$result = $dashletInstance->save();
|
||||
$connection->commit();
|
||||
|
||||
$dashletData = $this->load($data['DAS_INS_UID']);
|
||||
G::auditLog($msg, "Dashlet Instance Name: ".$dashletData['DAS_INS_TITLE']." Dashlet Instance ID: (".$dashletData['DAS_INS_UID'].") ");
|
||||
|
||||
return $data['DAS_INS_UID'];
|
||||
} else {
|
||||
$message = '';
|
||||
@@ -88,8 +94,11 @@ class DashletInstance extends BaseDashletInstance
|
||||
$dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid);
|
||||
if (!is_null($dashletInstance)) {
|
||||
$connection->begin();
|
||||
$dashletData = $this->load($dasInsUid);
|
||||
$result = $dashletInstance->delete();
|
||||
$connection->commit();
|
||||
|
||||
G::auditLog("DeleteDashletInstance", "Dashlet Instance Name: ". $dashletData['DAS_INS_TITLE']." Dashlet Instance ID: (".$dasInsUid.") ");
|
||||
return $result;
|
||||
} else {
|
||||
throw new Exception('Error trying to delete: The row "' . $dasInsUid. '" does not exist.');
|
||||
|
||||
@@ -61,6 +61,12 @@ class Department extends BaseDepartment
|
||||
$this->setDepUid( G::generateUniqueID() );
|
||||
}
|
||||
|
||||
if (isset( $aData['DEP_PARENT'] ) && ($aData['DEP_PARENT'] =='')) {
|
||||
$msgLog = 'Departament';
|
||||
} else {
|
||||
$msgLog = 'SubDepartament';
|
||||
}
|
||||
|
||||
if (isset( $aData['DEP_PARENT'] )) {
|
||||
$this->setDepParent( $aData['DEP_PARENT'] );
|
||||
} else {
|
||||
@@ -108,6 +114,9 @@ class Department extends BaseDepartment
|
||||
$res = $this->save();
|
||||
|
||||
$con->commit();
|
||||
|
||||
G::auditLog("Create".$msgLog, $msgLog." Name: ". $aData['DEP_TITLE']);
|
||||
|
||||
return $this->getDepUid();
|
||||
} else {
|
||||
$msg = '';
|
||||
@@ -277,8 +286,11 @@ class Department extends BaseDepartment
|
||||
|
||||
$oPro = DepartmentPeer::retrieveByPK( $ProUid );
|
||||
if (! is_null( $oPro )) {
|
||||
$dptoTitle = $this->Load($oPro->getDepUid());
|
||||
Content::removeContent( 'DEPO_TITLE', '', $oPro->getDepUid() );
|
||||
Content::removeContent( 'DEPO_DESCRIPTION', '', $oPro->getDepUid() );
|
||||
|
||||
G::auditLog("DeleteDepartament", "Departament Name: ".$dptoTitle['DEPO_TITLE']." Departament ID: (".$oPro->getDepUid().") ");
|
||||
return $oPro->delete();
|
||||
} else {
|
||||
throw (new Exception( "The row '$ProUid' in table Group doesn't exist!" ));
|
||||
@@ -320,10 +332,11 @@ class Department extends BaseDepartment
|
||||
}
|
||||
|
||||
public function updateDepartmentManager ($depId)
|
||||
{
|
||||
{
|
||||
$managerId = '';
|
||||
$depParent = '';
|
||||
$oDept = DepartmentPeer::retrieveByPk( $depId );
|
||||
|
||||
if (is_object( $oDept ) && get_class( $oDept ) == 'Department') {
|
||||
$managerId = $oDept->getDepManager();
|
||||
$depParent = $oDept->getDepParent();
|
||||
@@ -353,7 +366,12 @@ class Department extends BaseDepartment
|
||||
}
|
||||
$oUser->save();
|
||||
}
|
||||
|
||||
|
||||
if ($managerId) {
|
||||
$user = $oUser->loadDetailed ($managerId);
|
||||
$dptoTitle = $oDept->Load($depId);
|
||||
G::auditLog("AssignManagerToDepartament", "Assign Manager ".$user['USR_USERNAME']." (".$managerId.") to ".$dptoTitle['DEPO_TITLE']." (".$depId.") ");
|
||||
}
|
||||
// get children departments to update the reportsTo of these children
|
||||
$childrenCriteria = new Criteria( 'workflow' );
|
||||
$childrenCriteria->add( DepartmentPeer::DEP_PARENT, $depId );
|
||||
@@ -378,9 +396,13 @@ class Department extends BaseDepartment
|
||||
try {
|
||||
//update the field in user table
|
||||
$oUser = UsersPeer::retrieveByPk( $userId );
|
||||
$user = $oUser->loadDetailed ($userId);
|
||||
$dptoTitle = $this->Load($depId);
|
||||
|
||||
if (is_object( $oUser ) && get_class( $oUser ) == 'Users') {
|
||||
$oUser->setDepUid( $depId );
|
||||
$oUser->save();
|
||||
G::auditLog("AssignUserToDepartament", "Assign user ".$user['USR_USERNAME']." (".$userId.") to departament ".$dptoTitle['DEPO_TITLE']." (".$depId.") ");
|
||||
}
|
||||
|
||||
//if the user is a manager update Department Table
|
||||
@@ -549,11 +571,16 @@ class Department extends BaseDepartment
|
||||
);
|
||||
try {
|
||||
$oUser = UsersPeer::retrieveByPk( $UsrUid );
|
||||
$user = $oUser->loadDetailed ($UsrUid);
|
||||
$dptoTitle = $this->Load($DepUid);
|
||||
|
||||
if (is_object( $oUser ) && get_class( $oUser ) == 'Users') {
|
||||
//$oDepto = new Users();
|
||||
$oUser->setDepUid( '' );
|
||||
$oUser->setUsrReportsTo( '' );
|
||||
$oUser->save();
|
||||
|
||||
G::auditLog("RemoveUsersFromDepartament", "Remove user ".$user['USR_USERNAME']."( ".$UsrUid.") from departament ".$dptoTitle['DEPO_TITLE']." (".$DepUid.") ");
|
||||
}
|
||||
} catch (exception $oError) {
|
||||
throw ($oError);
|
||||
|
||||
@@ -91,6 +91,15 @@ class GroupUser extends BaseGroupUser
|
||||
$oConnection->begin();
|
||||
$iResult = $oGroupUser->delete();
|
||||
$oConnection->commit();
|
||||
|
||||
$oGrpwf = new Groupwf();
|
||||
$grpName = $oGrpwf->loadByGroupUid($sGrpUid);
|
||||
|
||||
$oUsr = new Users();
|
||||
$usrName = $oUsr->load($sUserUid);
|
||||
|
||||
G::auditLog("AssignUserToGroup", "Remove user: ".$usrName['USR_USERNAME'] ." (".$sUserUid.") from group ".$grpName['CON_VALUE']." (".$sGrpUid.") ");
|
||||
|
||||
return $iResult;
|
||||
} else {
|
||||
throw (new Exception( 'This row doesn\'t exist!' ));
|
||||
|
||||
@@ -272,6 +272,26 @@ class Groupwf extends BaseGroupwf
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function loadByGroupUid ($UidGroup)
|
||||
{
|
||||
$c = new Criteria( 'workflow' );
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
|
||||
$c->add( ContentPeer::CON_CATEGORY, 'GRP_TITLE' );
|
||||
$c->add( ContentPeer::CON_ID, $UidGroup );
|
||||
$c->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||
|
||||
$dataset = ContentPeer::doSelectRS( $c );
|
||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
$row = $dataset->getRow();
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
public function getAll ($start = null, $limit = null, $search = null)
|
||||
{
|
||||
$totalCount = 0;
|
||||
|
||||
@@ -301,6 +301,8 @@ class Language extends BaseLanguage
|
||||
$results->headers = $POHeaders;
|
||||
$results->errMsg = $errorMsg;
|
||||
|
||||
G::auditLog("UploadLanguage", "Language: ".$languageID);
|
||||
|
||||
return $results;
|
||||
} catch (Exception $oError) {
|
||||
throw ($oError);
|
||||
@@ -549,6 +551,7 @@ class Language extends BaseLanguage
|
||||
}
|
||||
} //end foreach
|
||||
}
|
||||
G::auditLog("ExportLanguage", "Language: ".$_GET['LOCALE']);
|
||||
G::streamFile( $sPOFile, true );
|
||||
}
|
||||
public function updateLanguagePlugin ($plugin, $idLanguage)
|
||||
|
||||
@@ -55,6 +55,22 @@ class ProcessCategory extends BaseProcessCategory
|
||||
return $aRow;
|
||||
}
|
||||
|
||||
public function loadByCategoryId($sCategoryUid)
|
||||
{
|
||||
$c = new Criteria('workflow');
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( ProcessCategoryPeer::CATEGORY_NAME);
|
||||
|
||||
$c->add(ProcessCategoryPeer::CATEGORY_UID, $sCategoryUid);
|
||||
$dataset = ProcessCategoryPeer::doSelectRS($c);
|
||||
$dataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
return $aRow['CATEGORY_NAME'];
|
||||
}
|
||||
|
||||
public function exists ($catUid)
|
||||
{
|
||||
$oProCat = ProcessCategoryPeer::retrieveByPk( $catUid );
|
||||
|
||||
@@ -454,6 +454,7 @@ class Translation extends BaseTranslation
|
||||
if (file_exists( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' )) {
|
||||
G::rm_dir( PATH_CORE . PATH_SEP . 'content' . PATH_SEP . 'translations' . PATH_SEP . 'processmaker' . $locale . '.po' );
|
||||
}
|
||||
G::auditLog("DeleteLanguage", "Language: ".$locale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user