diff --git a/apps/maarch_entreprise/Models/HistoryModelAbstract.php b/apps/maarch_entreprise/Models/HistoryModelAbstract.php index a9a97e4f88cce194227ee654f845f112f5710887..da17969cbcfcbb088b6f4a34859e38e0dc663009 100644 --- a/apps/maarch_entreprise/Models/HistoryModelAbstract.php +++ b/apps/maarch_entreprise/Models/HistoryModelAbstract.php @@ -34,7 +34,7 @@ class HistoryModelAbstract extends Apps_Table_Service 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'table' => ['history', 'users'], 'left_join' => ['history.user_id = users.user_id'], - 'where' => ['history.record_id = ?', 'history.event_type like ?', 'history.event_id ~ ?'], + 'where' => ['history.record_id = ?', 'history.event_type like ?', 'history.event_id NOT LIKE ?'], 'data' => [$aArgs['id'], 'ACTION#%', '^[0-9]+$'], 'order_by' => empty($aArgs['orderBy']) ? ['event_date'] : $aArgs['orderBy'] ]); diff --git a/apps/maarch_entreprise/Views/status-administration.component.html b/apps/maarch_entreprise/Views/status-administration.component.html index 6479d1c286f73cf8a370b7b842a414d6467f3d98..1d599282e1ba8b1b334d8e2a9abaa89a7888772a 100644 --- a/apps/maarch_entreprise/Views/status-administration.component.html +++ b/apps/maarch_entreprise/Views/status-administration.component.html @@ -28,22 +28,25 @@ <p> <label for="can_be_searched">{{lang.can_be_searched}}</label> - <textarea name="can_be_searched" id="can_be_searched" [(ngModel)]="status.can_be_searched" ></textarea> + <input type="radio" name="can_be_searched" class="check" value="Y" [(ngModel)]="status.can_be_searched">Oui + <input type="radio" name="can_be_searched" class="check" value="N" [(ngModel)]="status.can_be_searched">Non </p> <p> <label for="can_be_modified">{{lang.can_be_modified}}</label> - <textarea name="can_be_modified" id="can_be_modified" [(ngModel)]="status.can_be_modified" ></textarea> + <input type="radio" name="can_be_modified" class="check" value="Y" [(ngModel)]="status.can_be_modified"checked="checked">Oui + <input type="radio" name="can_be_modified" class="check" value="N" [(ngModel)]="status.can_be_modified">Non </p> <p> <label for="is_folder_status">{{lang.is_folder_status}}</label> - <textarea name="is_folder_status" id="is_folder_status" [(ngModel)]="status.is_folder_status" ></textarea> + <input type="radio" name="is_folder_status" class="check" value="Y" [(ngModel)]="status.is_folder_status">Oui + <input type="radio" name="is_folder_status" class="check" value="N" [(ngModel)]="status.is_folder_status">Non </p> <p> - <label for="img_related">{{lang.img_related}}</label> - <textarea name="img_related" id="img_related" [(ngModel)]="status.img_related" ></textarea> + <label for="img_filename">{{lang.img_related}}</label> + <textarea name="img_filename" id="img_filename" [(ngModel)]="status.img_filename" ></textarea> </p> <p class="button" style="text-align:center"> diff --git a/apps/maarch_entreprise/class/class_lists_Abstract.php b/apps/maarch_entreprise/class/class_lists_Abstract.php index bd6e10cb02670020df02ada0345a0e62b5d8cf88..31fbad2f1931d85584ecc6d4b1ddbe73450c0358 100644 --- a/apps/maarch_entreprise/class/class_lists_Abstract.php +++ b/apps/maarch_entreprise/class/class_lists_Abstract.php @@ -212,7 +212,7 @@ abstract class lists_Abstract extends Database "SELECT distinct(r.destination) as entity_id, count(distinct r.res_id)" . " as total, e.entity_label , e.short_label FROM " . $view. " r left join " . ENT_ENTITIES - . " e on e.entity_id = r.destination " .$where . " and entity_id <> ''" + . " e on e.entity_id = r.destination " .$where . " and (e.entity_id <> '' or e.entity_id IS NOT NULL)" . " group by e.entity_label, e.short_label, r.destination order by e.entity_label" ); while ($res = $stmt->fetchObject()) { diff --git a/apps/maarch_entreprise/indexing_searching/document_workflow_history.php b/apps/maarch_entreprise/indexing_searching/document_workflow_history.php index c53ddb7752f9c5d4b21d86827dedff3b287e72a0..b69be4eda4fd83d33b0dbe819bb558f4d383c787 100644 --- a/apps/maarch_entreprise/indexing_searching/document_workflow_history.php +++ b/apps/maarch_entreprise/indexing_searching/document_workflow_history.php @@ -142,7 +142,7 @@ if (isset($_REQUEST['load'])) { .".lastname, h.info FROM " .$_SESSION['tablename']['history'] ." h, ".$_SESSION['tablename']['users'] ." WHERE " .$whereTableOrView." and h.record_id = ? and h.user_id = ".$_SESSION['tablename']['users'] - .".user_id".$where." and event_id ~ '^[0-9]+$' and event_type like 'ACTION#%' ".$orderstr, array($id)); + .".user_id".$where." and event_id NOT LIKE '^[0-9]+$' and event_type like 'ACTION#%' ".$orderstr, array($id)); // $request->show(); $tab=array(); diff --git a/apps/maarch_entreprise/js/angular/app/status-administration.component.js b/apps/maarch_entreprise/js/angular/app/status-administration.component.js index df076dc31dedc7c841fce6bd683aa1d3fda1011f..1d47c4ebaea9d537159b1e3b2eba3474cfe93962 100644 --- a/apps/maarch_entreprise/js/angular/app/status-administration.component.js +++ b/apps/maarch_entreprise/js/angular/app/status-administration.component.js @@ -22,11 +22,11 @@ var StatusAdministrationComponent = (function () { this.mode = null; this.status = { id: null, - description: null, + label_status: null, can_be_searched: null, can_be_modified: null, is_folder_status: null, - img_related: null + img_filename: null }; this.lang = ""; this.resultInfo = ""; diff --git a/apps/maarch_entreprise/js/angular/app/status-administration.component.ts b/apps/maarch_entreprise/js/angular/app/status-administration.component.ts index 758294261ce8957abfd7234c4f18f83fa8d87f13..18600f83de22ca710ea64014b84cbecf306159df 100644 --- a/apps/maarch_entreprise/js/angular/app/status-administration.component.ts +++ b/apps/maarch_entreprise/js/angular/app/status-administration.component.ts @@ -18,11 +18,11 @@ export class StatusAdministrationComponent implements OnInit { type : string; status : any = { id : null, - description : null, + label_status : null, can_be_searched : null, can_be_modified : null, is_folder_status : null, - img_related : null + img_filename : null }; paramDateTemp : string; lang : any = ""; diff --git a/core/Controllers/StatusController.php b/core/Controllers/StatusController.php index c83795ecc951b2f9756f44956b64b97ec4d7f215..17733144188817e3d7a1c9da897be69946dc7aa5 100644 --- a/core/Controllers/StatusController.php +++ b/core/Controllers/StatusController.php @@ -73,7 +73,7 @@ class StatusController ->withJson(['errors' => $errors]); } - $aArgs = $request->getQueryParams(); + $aArgs = $request->getParams(); $return = StatusModel::create($aArgs); @@ -107,7 +107,7 @@ class StatusController ->withJson(['errors' => $errors]); } - $aArgs = $request->getQueryParams(); + $aArgs = $request->getParams(); $return = StatusModel::update($aArgs); diff --git a/core/Models/LangModelAbstract.php b/core/Models/LangModelAbstract.php index 4a8e7cc5dd15151dcfd1da45b8d06d9e67e4b86c..888d7e276ea81533d3af729d65db3853bde254f0 100644 --- a/core/Models/LangModelAbstract.php +++ b/core/Models/LangModelAbstract.php @@ -170,6 +170,7 @@ class LangModelAbstract 'yes' => _YES, 'no' => _NO, 'modify_status' => _MODIFY_STATUS, + 'deleteConfirm' => _REALLY_DELETE, ]; return $aLang; } diff --git a/core/Models/StatusModelAbstract.php b/core/Models/StatusModelAbstract.php index 33aa6c7306ada82b4317d7e2ecaeda0c665d34c5..608453954ffb92c313ffd4bdf5b38435b01d4056 100644 --- a/core/Models/StatusModelAbstract.php +++ b/core/Models/StatusModelAbstract.php @@ -22,7 +22,7 @@ class StatusModelAbstract extends \Apps_Table_Service public static function getList() { $aReturn = static::select([ - 'select' => '*', + 'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'], 'table' => ['status'], ]); @@ -88,4 +88,4 @@ class StatusModelAbstract extends \Apps_Table_Service return $aReturn; } -} +} \ No newline at end of file diff --git a/modules/notifications/batch/stack_letterbox_alerts.php b/modules/notifications/batch/stack_letterbox_alerts.php index 448ea9f11b3245151a41460ec8ff398144e5cb75..5c0f7d8687f3cf3330c0e212b1eb1976f46fc7c2 100644 --- a/modules/notifications/batch/stack_letterbox_alerts.php +++ b/modules/notifications/batch/stack_letterbox_alerts.php @@ -16,11 +16,15 @@ while ($state <> 'END') { /* Load parameters */ /**********************************************************************/ case 'LOAD_ALERTS_NOTIFS' : + $query = "SELECT count(1) as count FROM " + . _NOTIFICATIONS_TABLE_NAME + . " WHERE event_id IN ('alert1', 'alert2') "; + $stmt = Bt_doQuery($db, $query); + $totalAlertsToProcess = $stmt->fetchObject()->count; $query = "SELECT notification_sid, event_id FROM " - . _NOTIFICATIONS_TABLE_NAME - . " WHERE event_id IN ('alert1', 'alert2') "; + . _NOTIFICATIONS_TABLE_NAME + . " WHERE event_id IN ('alert1', 'alert2') "; $stmt = Bt_doQuery($db, $query); - $totalAlertsToProcess = $stmt->rowCount(); if ($totalAlertsToProcess === 0) { Bt_exitBatch(0, 'No alert parametered'); } @@ -38,9 +42,11 @@ while ($state <> 'END') { /* Load parameters */ /**********************************************************************/ case 'LOAD_DOCTYPES' : + $query = "SELECT count(1) as count FROM " . $collDoctypeExt; + $stmt = Bt_doQuery($db, $query); + $totalDocTypes = $stmt->fetchObject()->count; $query = "SELECT * FROM " . $collDoctypeExt; $stmt = Bt_doQuery($db, $query); - $totalDocTypes = $stmt->rowCount(); $GLOBALS['doctypes'] = array(); while ($doctypeRecordset = $stmt->fetchObject()) { $GLOBALS['doctypes'][$doctypeRecordset->type_id] = $doctypeRecordset; @@ -53,6 +59,14 @@ while ($state <> 'END') { /* List the resources to proccess for alarms */ /**********************************************************************/ case 'LIST_DOCS' : + $query = "SELECT count(1) as count" + . " FROM " . $collView + . " WHERE closing_date IS null" + . " AND status NOT IN ('CLO', 'DEL', 'END')" + . " AND (flag_alarm1 = 'N' OR flag_alarm2 = 'N')" + . " AND process_limit_date IS NOT NULL"; + $stmt = Bt_doQuery($GLOBALS['db'], $query); + $totalDocsToProcess = $stmt->fetchObject()->count; $query = "SELECT res_id, type_id, process_limit_date, flag_alarm1, flag_alarm2" . " FROM " . $collView . " WHERE closing_date IS null" @@ -60,7 +74,6 @@ while ($state <> 'END') { . " AND (flag_alarm1 = 'N' OR flag_alarm2 = 'N')" . " AND process_limit_date IS NOT NULL"; $stmt = Bt_doQuery($GLOBALS['db'], $query); - $totalDocsToProcess = $stmt->rowCount(); $currentDoc = 0; if ($totalDocsToProcess === 0) { Bt_exitBatch(0, 'No document to process'); diff --git a/rest/index.php b/rest/index.php index a91c109e65b95bcf45a1de9a35aa7d41b4fedde8..0e8ddfde943b6122086561b407d801e7cf134582 100644 --- a/rest/index.php +++ b/rest/index.php @@ -109,7 +109,7 @@ $app->get('/administration/status', \Core\Controllers\StatusController::class . $app->get('/status/lang', \Core\Controllers\StatusController::class . ':getLang'); $app->get('/status/{id}', \Core\Controllers\StatusController::class . ':getById'); $app->post('/status', \Core\Controllers\StatusController::class . ':create'); -$app->put('/status', \Core\Controllers\StatusController::class . ':update'); +$app->put('/status/{id}', \Core\Controllers\StatusController::class . ':update'); $app->delete('/status/{id}', \Core\Controllers\StatusController::class . ':delete'); //docserver